Merge pull request #2865 from barthalion/increase-metadata-size

Increase the metadata size limit to 128MB
This commit is contained in:
Dan Nicholson 2023-06-13 09:02:48 -06:00 committed by GitHub
commit 9244518896
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -35,7 +35,7 @@ G_BEGIN_DECLS
* objects). This is an arbitrary number intended to mitigate disk space
* exhaustion attacks.
*/
#define OSTREE_MAX_METADATA_SIZE (10 * 1024 * 1024)
#define OSTREE_MAX_METADATA_SIZE (128 * 1024 * 1024)
/**
* OSTREE_MAX_METADATA_WARN_SIZE:

View File

@ -417,7 +417,7 @@ test_big_metadata (void)
g_assert_no_error (error);
g_assert (ret);
const size_t len = 20 * 1024 * 1024;
const size_t len = OSTREE_MAX_METADATA_SIZE + 1;
g_assert_cmpint (len, >, OSTREE_MAX_METADATA_SIZE);
g_autofree char *large_buf = g_malloc (len);
memset (large_buf, 0x42, len);

View File

@ -25,10 +25,11 @@ setup_fake_remote_repo1 "archive"
echo '1..1'
# Overwrite the commit object with 20 M of
# Overwrite the commit object with 121 M of zeroes. This is based on the
# OSTREE_MAX_METADATA_SIZE constant in src/libostree/ostree-core.h
cd ${test_tmpdir}
rev=$(cd ostree-srv && ${CMD_PREFIX} ostree --repo=gnomerepo rev-parse main)
dd if=/dev/zero bs=1M count=20 of=ostree-srv/gnomerepo/objects/$(echo $rev | cut -b 1-2)/$(echo $rev | cut -b 3-).commit
dd if=/dev/zero bs=1M count=130 of=ostree-srv/gnomerepo/objects/$(echo $rev | cut -b 1-2)/$(echo $rev | cut -b 3-).commit
cd ${test_tmpdir}
mkdir repo