From: Theodore Ts'o Date: Fri, 30 Mar 2018 02:10:31 +0000 (-0400) Subject: ext4: always initialize the crc32c checksum driver X-Git-Tag: v4.1.12-124.31.3~333 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c18c89b21a70352e84a7887581d00ffbe4e202bd;p=users%2Fjedix%2Flinux-maple.git 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=1560788 Signed-off-by: Theodore Ts'o Cc: stable@vger.kernel.org (cherry picked from commit a45403b51582a87872927a3e0fc0a389c26867f1) Orabug: 29114440 CVE: CVE-2018-1094 Signed-off-by: John Donnelly Reviewed-by: Darren Kenny Signed-off-by: Brian Maly --- diff --git a/fs/ext4/super.c b/fs/ext4/super.c index c4326f16573d..00783dda0f79 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3546,14 +3546,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)) { - 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 */