lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180821175937.155466-1-ebiggers@kernel.org>
Date:   Tue, 21 Aug 2018 10:59:37 -0700
From:   Eric Biggers <ebiggers@...nel.org>
To:     Theodore Ts'o <tytso@....edu>, linux-ext4@...r.kernel.org
Subject: [PATCH] e2fsck: allow verity files to have initialized blocks past i_size

From: Eric Biggers <ebiggers@...gle.com>

Since ext4 verity is going to be an RO_COMPAT feature rather than an
INCOMPAT one, the on-disk i_size of verity inodes needs to be the data
size rather than the full size.  Consequently, verity inodes will have
initialized blocks past i_size, containing the Merkle tree and other
verity metadata.  So e2fsck must not fix the i_size of such inodes as it
normally would.

Signed-off-by: Eric Biggers <ebiggers@...gle.com>
---
 e2fsck/pass1.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index ce43821d..8abf0c33 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -3447,7 +3447,8 @@ static void check_blocks(e2fsck_t ctx, struct problem_context *pctx,
 		size = EXT2_I_SIZE(inode);
 		if ((pb.last_init_lblock >= 0) &&
 		    /* Do not allow initialized allocated blocks past i_size*/
-		    (size < (__u64)pb.last_init_lblock * fs->blocksize))
+		    (size < (__u64)pb.last_init_lblock * fs->blocksize) &&
+		    !(inode->i_flags & EXT4_VERITY_FL))
 			bad_size = 3;
 		else if (!(extent_fs && (inode->i_flags & EXT4_EXTENTS_FL)) &&
 			 size > ext2_max_sizes[fs->super->s_log_block_size])
-- 
2.18.0.865.gffc8e1a3cd6-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ