Commit a45403b5 authored by Theodore Ts'o's avatar Theodore Ts'o

ext4: always initialize the crc32c checksum driver

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.

This issue has been assigned CVE-2018-1094.

https://bugzilla.kernel.org/show_bug.cgi?id=199183
https://bugzilla.redhat.com/show_bug.cgi?id=1560788Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
parent 8e4b5eae
...@@ -3492,15 +3492,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ...@@ -3492,15 +3492,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
} }
/* Load the checksum driver */ /* Load the checksum driver */
if (ext4_has_feature_metadata_csum(sb) || sbi->s_chksum_driver = crypto_alloc_shash("crc32c", 0, 0);
ext4_has_feature_ea_inode(sb)) { if (IS_ERR(sbi->s_chksum_driver)) {
sbi->s_chksum_driver = crypto_alloc_shash("crc32c", 0, 0); ext4_msg(sb, KERN_ERR, "Cannot load crc32c driver.");
if (IS_ERR(sbi->s_chksum_driver)) { ret = PTR_ERR(sbi->s_chksum_driver);
ext4_msg(sb, KERN_ERR, "Cannot load crc32c driver."); sbi->s_chksum_driver = NULL;
ret = PTR_ERR(sbi->s_chksum_driver); goto failed_mount;
sbi->s_chksum_driver = NULL;
goto failed_mount;
}
} }
/* Check superblock checksum */ /* Check superblock checksum */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment