Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3326248rwa; Tue, 23 Aug 2022 02:54:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR5K5oqNY4AYyx5mkiuZcXIU/3PSSgCOZhA6qQ+kghpuJuEcpZxprHrypKCdjzBH3F4DHEnf X-Received: by 2002:a05:6402:358a:b0:446:da94:e68c with SMTP id y10-20020a056402358a00b00446da94e68cmr2918212edc.356.1661248479190; Tue, 23 Aug 2022 02:54:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248479; cv=none; d=google.com; s=arc-20160816; b=URQQjB0qpYvGu2uN1bPZDhNAX9cjEQmR7ugirQsz4z+FIA42ymB06Nv/UDG2pfrYH7 7VCpcLFUC2ck6dsE5SzuFo53rdXLSD0kO84QIJxXDLaAyZs2S7YWx45yPNIKxsLZJdZ+ i5xKq6VY8CrqWq+Y1zXaxsJWJrkEjXaQTx5jxCZGJekVTZrvBh+BeciZQP3SejBRkvdD Ehi0dZHdO8fT0aVJDxDEWo/RGwf2Dux64GXPHKsSgxgOnmefCLLarr3H9Skzb2aEegO+ XpFbeB6KdFRGLiDphsmd3D9ZhOCC9voRQIM3p+BuE/2DY5ShIkgChYRz4Y4TOZMOf5dG Fs2w== 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=kCc5U0EDCUcfTYvTM3G2+POJ5jS0y9nTG89ujdOJFeaV2mq/VSqciPqJAs72U3TitS cZp3WfUEHktRBBKkgi27wb3CvKsshV5sAJOwv6IEak+MiML1w6ghtHsDsMOT0bOWc5cw G7pULTj0I79w3Uj7CoZJOhI/NaJakUC9HLSiPgtpTiiRTIsbI61xsrEJO6W54nmMGQKV h+qeYH1u6BvBhzbyhtUny4Nsncnn9N81jtq6/k/dWQlwR0/dJCeOLj5UdSXpoRjiRkOO jLhCXuIJ4R+pocM/HhEYx1sMZO4dit+8S5gG1qrYbdCdWKaKmtfzCUJXhJTVFsi/Zdm/ uzeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="fB/K8e4F"; 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 u10-20020a50c04a000000b0043bfb069e20si1677661edd.458.2022.08.23.02.54.13; Tue, 23 Aug 2022 02:54:39 -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="fB/K8e4F"; 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 S241072AbiHWI5r (ORCPT + 99 others); Tue, 23 Aug 2022 04:57:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241016AbiHWI5W (ORCPT ); Tue, 23 Aug 2022 04:57:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC1888049F; Tue, 23 Aug 2022 01:25:33 -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 ams.source.kernel.org (Postfix) with ESMTPS id 8131AB81C50; Tue, 23 Aug 2022 08:19:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D44F2C433D7; Tue, 23 Aug 2022 08:19:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661242762; bh=2MjMmv1DWYOrh+U1u+hL4AFpZ83wNRy9AWvFn4o+AHU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fB/K8e4F+E5apPYoT25Mr2yoltJBFxF/71B3Fh54uVsayYdR/W/3mmAo5jrQYBKP+ /i0mrJS7/OG+C6fQJts+t6TXoLeOAu5nbOdFdhTbFv4jk6e9Vq2YVId7+2oKMZtDcT GS9szMeiTe4Nk0VBlckA6z5WikTSKIZeBv8kSZAs= 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.19 165/365] fs/ntfs3: Fix missing i_op in ntfs_read_mft Date: Tue, 23 Aug 2022 10:01:06 +0200 Message-Id: <20220823080125.115283591@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@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;