Received: by 10.192.165.148 with SMTP id m20csp2534011imm; Sun, 22 Apr 2018 09:02:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx48svU8cW5RJcnzxaaX1JGHA8ZTDXD0B4a7yk7B8iNWNOGw4LSJXBtUlkK/Z2XPPBo+3o3Eg X-Received: by 10.101.90.129 with SMTP id c1mr14657526pgt.20.1524412940774; Sun, 22 Apr 2018 09:02:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524412940; cv=none; d=google.com; s=arc-20160816; b=vorvMtIUkR6AmaXrCX9ZU2KmlAYYwmnwfsoVNs/XjHrz2f3IWh8UoiNRkcJA6XaAYh znCfM/pfNDJpMvzTxfLnZ0Ej9ojeX7igXhhT+QuRA6rriXBH7pdMuBkHdDgzogX9oBpV 6bPRIUMbA3WhkjHXuvCvoqCzBh9NupKFbWZ2i3q6qcuvfFaIKfswij6ObMPWtA6h9gpf 6gY29uLVNyzJwS6T2vt5gQJaIvFQrnFM1EOXk9CiUuPJP1zBCuC93ZxnUW5zv+akKSr2 ICco+WSgJkyFeSpJz8Slenc+MzKcIOTqmQwR2JqZ/8TsuUYcsX10YKcDFqOzGDofhNh4 PUCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Kf+dlfNjlFz3IPp8dKf4tRj9yffeV4dsSWBtKh2hj2I=; b=dJxGTAw8wemGDc9r+KL/Xpi7r8I4BwINLJzDGHTO7HDgdk6+Nz4QOfA4vhuysQzpW/ xypc1gqBoYiGCh1cpeF/FkDKsLGGZn403iYg9HhjVUCfop7gwXQZcOAoIBvq9aoDNgny rfnzMZ7dGrbuXHR23+wX3P/mRGDJRdXmpOtqJUvC6eJDz1JeHD+w1Mdz3rHtkqeB8Whb ARWsVifM/JKPRTJkEODZAqD5eBnS8SO9D7t++AyaNpY7+cT2Uy6OJIdXZfuxb3gvIaMK 2/ZxgDOBs9K4KNJ+GCbB3+RP2nkTgx8c2X6IWPH/UfeDdqlbv9R/fQrkQBzc5Md7+K97 ju+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1-v6si9733923plb.8.2018.04.22.09.02.06; Sun, 22 Apr 2018 09:02:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754519AbeDVQAz (ORCPT + 99 others); Sun, 22 Apr 2018 12:00:55 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46264 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754171AbeDVN6b (ORCPT ); Sun, 22 Apr 2018 09:58:31 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 45419CD8; Sun, 22 Apr 2018 13:58:30 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Theodore Tso Subject: [PATCH 4.16 094/196] ext4: always initialize the crc32c checksum driver Date: Sun, 22 Apr 2018 15:51:54 +0200 Message-Id: <20180422135109.151839245@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Theodore Ts'o 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 Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/ext4/super.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3490,15 +3490,12 @@ static int ext4_fill_super(struct super_ } /* 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 */