From: Ruediger Meier Date: Sun, 18 May 2014 22:43:53 +0000 (+0200) Subject: fsck.cramfs: allow smaller superblock sizes X-Git-Tag: v2.25-rc1~121^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f991dbd31f409f6bec8f2b84065f820936b6b4cb;p=thirdparty%2Futil-linux.git fsck.cramfs: allow smaller superblock sizes We are already fine with checking for different endianess. Now we also succeed if systems's page size does not match. Note that page_size is only really used if INCLUDE_FS_TESTS is defined, see followups. Signed-off-by: Ruediger Meier --- diff --git a/disk-utils/fsck.cramfs.c b/disk-utils/fsck.cramfs.c index 66523f4dec..00ea2ab569 100644 --- a/disk-utils/fsck.cramfs.c +++ b/disk-utils/fsck.cramfs.c @@ -189,7 +189,8 @@ static void test_super(int *start, size_t * length) if (super.flags & ~CRAMFS_SUPPORTED_FLAGS) errx(FSCK_EX_ERROR, _("unsupported filesystem features")); - if (super.size < page_size) + /* What are valid superblock sizes? */ + if (super.size < sizeof(struct cramfs_super)) errx(FSCK_EX_UNCORRECTED, _("superblock size (%d) too small"), super.size);