diff options
author | Theodore Ts'o <tytso@mit.edu> | 2018-03-29 22:10:31 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-04-24 09:36:30 +0200 |
commit | 26dbb30c58ffb85bc015bd5e58831483d50f7d18 (patch) | |
tree | a8ec834289168c5a4863dbb8fc4f8f92a8250bf8 /fs/ext4/super.c | |
parent | 8e0e94683f8449f4e83b4b563b80eb9c76b9e18f (diff) | |
download | linux-stable-26dbb30c58ffb85bc015bd5e58831483d50f7d18.tar.gz linux-stable-26dbb30c58ffb85bc015bd5e58831483d50f7d18.tar.bz2 linux-stable-26dbb30c58ffb85bc015bd5e58831483d50f7d18.zip |
ext4: always initialize the crc32c checksum driver
commit a45403b51582a87872927a3e0fc0a389c26867f1 upstream.
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=1560788
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 16d247f056e2..1339a79eb314 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3490,15 +3490,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 */ |