Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3338728rwa; Tue, 23 Aug 2022 03:08:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR68Jsr2o/EdTBuQ8pixolW92W4hJ95fUnTPD9HlpMQRMFpWmyXsviBCqlrj/iE1VBLH7WLd X-Received: by 2002:a05:6402:b84:b0:446:e89d:8a9c with SMTP id cf4-20020a0564020b8400b00446e89d8a9cmr2983917edb.413.1661249299955; Tue, 23 Aug 2022 03:08:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661249299; cv=none; d=google.com; s=arc-20160816; b=DX5hLxd86p5Zsqf1HFvUSCzdV+rvzCpssImBNi5Oq2goHSdfm4oD4PdmeSSln8WUlS si5556IUpUXMkTTWE9eQ0JwPobAUhXmBoMJzfqBzQKN/+q4xla2pHSP/y5Mc0AoTRrO9 rAT1uWprCV/RrIudbQRWr3whS94tlBlpsE4pTyWp4wqmvC0BhF602e4TJFbEsTZXYQJT h7rIy8+UME17mGewXEro78zwWL+h5qUjrluXKhC29u8wR7MnFiTXeU9/exc5Oq1r+HXM DOIcxmHnjgfKzKuWyQE2OCabVl+iAsGgdJWKsoLuqqc21rhB5bwDApZbjr2VyzXIVV31 9e3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hQ5Eol21KXkjLDbo4mTjrWv+Fvs1CPZ+g5vvEvxba7E=; b=ppZwtdp4Ip4q0KEdatsa5YBQV/8j6RVmmiVpayJe5wgP0hmGXYJy2ENPNlPJ/rXVvS KewGx0U5+dKmX0+m7eaXo93WSfm7/o2u1N8oRN1Gqacu2nwpS0dVhEVFYXLKYW9d1lLc fSg7Hu0mEAFlBnmZcjeJTF/142IdP7+f1WUEexjLjLAXVS28sG2qRNpX7NkQWPPQsE3X TkqPort5rtWF7w2Oy9HGPStw1/weyVZXDrOwBQ8nzzEeGOakABcTm6hvOtiy0fmSQSrY 7D4SR0IfqcFQqZp/cupKWPsxf9Bp8IvQ5/sIC+jGW2Z2rzwgEkUefDQHAq+f3nz6/FXj Z3cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mlAFuY89; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e7-20020a17090658c700b007307f95bc5dsi11447276ejs.383.2022.08.23.03.07.52; Tue, 23 Aug 2022 03:08:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mlAFuY89; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352565AbiHWKFx (ORCPT + 99 others); Tue, 23 Aug 2022 06:05:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352203AbiHWKBW (ORCPT ); Tue, 23 Aug 2022 06:01:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD7CB4055C; Tue, 23 Aug 2022 01:48:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CCDA36122F; Tue, 23 Aug 2022 08:48:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A359AC433C1; Tue, 23 Aug 2022 08:48:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244537; bh=2MjMmv1DWYOrh+U1u+hL4AFpZ83wNRy9AWvFn4o+AHU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mlAFuY89bxNTqXGTRJKnQpfw4yfqaWWZxEBKkYnkSmhj5YJ35x//13m5fumxcMF2O riM9QDkNUZ+Hhfg3nxiIytqAHUVyyzh+TMbKiY0Opuvlp0AQPgv9IxF+cUpKmRJoOm Paiuf3Q1KvRHNn1cf4wo3UgLGhm3EIxlhZ4PxjU0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liangbin Lian , Konstantin Komarov Subject: [PATCH 5.15 108/244] fs/ntfs3: Fix missing i_op in ntfs_read_mft Date: Tue, 23 Aug 2022 10:24:27 +0200 Message-Id: <20220823080102.621190771@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Konstantin Komarov commit 37a530bfe56ca9a0d3129598803f2794c7428aae upstream. There is null pointer dereference because i_op == NULL. The bug happens because we don't initialize i_op for records in $Extend. Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block") Reported-by: Liangbin Lian Signed-off-by: Konstantin Komarov Signed-off-by: Greg Kroah-Hartman --- fs/ntfs3/inode.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -430,6 +430,7 @@ end_enum: } else if (fname && fname->home.low == cpu_to_le32(MFT_REC_EXTEND) && fname->home.seq == cpu_to_le16(MFT_REC_EXTEND)) { /* Records in $Extend are not a files or general directories. */ + inode->i_op = &ntfs_file_inode_operations; } else { err = -EINVAL; goto out;