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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110901003836.1176.13428.stgit@elm3c44.beaverton.ibm.com>
Date:	Wed, 31 Aug 2011 17:38:36 -0700
From:	"Darrick J. Wong" <djwong@...ibm.com>
To:	Andreas Dilger <adilger.kernel@...ger.ca>,
	Theodore Tso <tytso@....edu>,
	"Darrick J. Wong" <djwong@...ibm.com>
Cc:	Sunil Mushran <sunil.mushran@...cle.com>,
	Amir Goldstein <amir73il@...il.com>,
	Andi Kleen <andi@...stfloor.org>,
	Mingming Cao <cmm@...ibm.com>,
	Joel Becker <jlbec@...lplan.org>, linux-ext4@...r.kernel.org,
	Coly Li <colyli@...il.com>
Subject: [PATCH 32/37] libext2fs: Extend inode checksum to cover the EA block

Now that e2fsprogs knows to read the entire s_inode_size, change the inode
checksum code to checksum the entire block.

Signed-off-by: Darrick J. Wong <djwong@...ibm.com>
---
 lib/ext2fs/csum.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)


diff --git a/lib/ext2fs/csum.c b/lib/ext2fs/csum.c
index 4fe4b3d..dc87de3 100644
--- a/lib/ext2fs/csum.c
+++ b/lib/ext2fs/csum.c
@@ -478,14 +478,9 @@ __u32 ext2fs_inode_csum(ext2_filsys fs, ext2_ino_t inum,
 {
 	struct ext2_inode_large *desc = inode;
 	int offset = offsetof(struct ext2_inode_large, i_checksum);
-	int extra_size = inode->i_extra_isize;
 	size_t size = fs->super->s_inode_size;
 	__u32 crc = 0;
 
-	if (size < EXT2_GOOD_OLD_INODE_SIZE + extra_size)
-		printf("ERROR: inode %d size %d != extra_size %d!\n", inum,
-		       size, extra_size + EXT2_GOOD_OLD_INODE_SIZE);
-
 	if (fs->super->s_creator_os != EXT2_OS_LINUX)
 		return 0;
 
@@ -508,8 +503,7 @@ __u32 ext2fs_inode_csum(ext2_filsys fs, ext2_ino_t inum,
 	crc = crc32c_le(crc, (char *)&inum, sizeof(inum));
 	crc = crc32c_le(crc, (char *)desc, offset);
 	offset += sizeof(inode->i_checksum); /* skip checksum */
-	crc = crc32c_le(crc, (char *)desc + offset,
-			   EXT2_GOOD_OLD_INODE_SIZE + extra_size - offset);
+	crc = crc32c_le(crc, (char *)desc + offset, size - offset);
 	return crc;
 }
 

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ