linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ext4: always initialize the crc32c checksum driver
@ 2018-03-26  4:49 Theodore Ts'o
  2018-03-26  4:49 ` [PATCH 2/2] ext4: don't allow r/w mounts if metadata blocks overlap the superblock Theodore Ts'o
  2018-04-01 12:19 ` [PATCH 1/2] ext4: always initialize the crc32c checksum driver Nikolay Borisov
  0 siblings, 2 replies; 4+ messages in thread
From: Theodore Ts'o @ 2018-03-26  4:49 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: Theodore Ts'o, stable

The extended attribute code now uses the crc32c checksum for hashing
purposes, so we should just always always initialize it.  We also want
to prevent NULL pointer dereferences if one of the metadata checksum
features is enabled after the file sytsem is originally mounted.

https://bugzilla.kernel.org/show_bug.cgi?id=199183

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
---
 fs/ext4/super.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 9d1da40c1f62..7cd022c344d1 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3492,15 +3492,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 	}
 
 	/* Load the checksum driver */
-	if (ext4_has_feature_metadata_csum(sb) ||
-	    ext4_has_feature_ea_inode(sb)) {
-		sbi->s_chksum_driver = crypto_alloc_shash("crc32c", 0, 0);
-		if (IS_ERR(sbi->s_chksum_driver)) {
-			ext4_msg(sb, KERN_ERR, "Cannot load crc32c driver.");
-			ret = PTR_ERR(sbi->s_chksum_driver);
-			sbi->s_chksum_driver = NULL;
-			goto failed_mount;
-		}
+	sbi->s_chksum_driver = crypto_alloc_shash("crc32c", 0, 0);
+	if (IS_ERR(sbi->s_chksum_driver)) {
+		ext4_msg(sb, KERN_ERR, "Cannot load crc32c driver.");
+		ret = PTR_ERR(sbi->s_chksum_driver);
+		sbi->s_chksum_driver = NULL;
+		goto failed_mount;
 	}
 
 	/* Check superblock checksum */
-- 
2.16.1.72.g5be1f00a9a

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-01 12:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-26  4:49 [PATCH 1/2] ext4: always initialize the crc32c checksum driver Theodore Ts'o
2018-03-26  4:49 ` [PATCH 2/2] ext4: don't allow r/w mounts if metadata blocks overlap the superblock Theodore Ts'o
2018-03-30 16:16   ` Sasha Levin
2018-04-01 12:19 ` [PATCH 1/2] ext4: always initialize the crc32c checksum driver Nikolay Borisov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).