From patchwork Tue Sep 26 09:57:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Konstantin Komarov X-Patchwork-Id: 144897 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp1933820vqu; Tue, 26 Sep 2023 06:57:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFT/+z2zfPcTUIBPxsNGwz+SacyjqbhWpYWlY1slGh5MVWcrlkwn/HtVcUDqZSwUDwVrDdH X-Received: by 2002:a05:6a20:9756:b0:154:d3ac:2050 with SMTP id hs22-20020a056a20975600b00154d3ac2050mr9687942pzc.33.1695736654048; Tue, 26 Sep 2023 06:57:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695736654; cv=none; d=google.com; s=arc-20160816; b=Ha8EYJCyw47SSkuPrpcCuAzXz9PB92/ew6mbx+by8bgdlqmnF6x1uHBWhGSZBCMlcl z6GBly3CNnmPd8HJYILMAtFiv1ndEkspO0eouQkyEdVz3hXJp2inN77ShMzZaEH66pX7 OZU+cYn4Yc17DVtGlWmDNh9TF7i1XJ2tHOEEXZ6yfMvAuy+bwMwTFQfP9qbE5ZH2DdFo iATTzbZVDaHUv55B89BzfhzeyIsMn88UjdoOJcTJYXFaT0cIKI4BJLpfwEuLC2qRFsjT qc0SWX46pWGoUM8xKUSXNvBfTiFAA+5aVOTdrFLm5jjUdsNHHeddMI8w3JLpe2modGOX 2L3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature:dkim-signature; bh=s8rZE6xcXKLHN8Ppy7AnwtG+R/usQmbqqKjeBuQwDZY=; fh=P7I85FIabZcM8ojWdeG8ABpTZepe/Xtte9jKWDfUHBM=; b=KGsB6NtMHdlznUaiw+b0OKx6KakHsllmAxkZEfTXo/YJloUPs/kMwArKTtZacLX98k ZDhr7/a9LTGCECi2GgVsdQL2BNiG4Ts5yTdFEPvI3YgKdoRfRkQsrT07T7hmQoNzZmuj 1zJO12WSYB36CtzXlvs1XeGQuOQXkWKTgvZ+lnx62F92vpbmpVwzDZf9FLxrMg/a7ShH HIzgPbR8v9nXqjEu6dlan7lyqKo3PxGO9HwYOGNdZekHTJR7l/gER8wUMYk6oslKDH0U 6FlM8yaCSXzyf6oRP3T6ybN79lhIG9JDsVeIGg0QWG4tV6F2MnFcS45nca8w3lVmr0rx 8ozw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=MHDIJ4At; dkim=pass header.i=@paragon-software.com header.s=mail header.b=k2j+Lznp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id o15-20020a656a4f000000b005774aba519dsi14392967pgu.298.2023.09.26.06.57.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 06:57:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=MHDIJ4At; dkim=pass header.i=@paragon-software.com header.s=mail header.b=k2j+Lznp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id AA6D88091C75; Tue, 26 Sep 2023 02:58:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234282AbjIZJ55 (ORCPT + 27 others); Tue, 26 Sep 2023 05:57:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234332AbjIZJ5r (ORCPT ); Tue, 26 Sep 2023 05:57:47 -0400 Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A43C112A; Tue, 26 Sep 2023 02:57:41 -0700 (PDT) Received: from relayfre-01.paragon-software.com (unknown [172.30.72.12]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id 5441221BC; Tue, 26 Sep 2023 09:51:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1695721909; bh=s8rZE6xcXKLHN8Ppy7AnwtG+R/usQmbqqKjeBuQwDZY=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=MHDIJ4AtXPOYLBeeoxB4jBb4KS/F5sja/tP5M1Rk6+iGEasCpT2S+bzvb0xAzDAtq Nq3ZKXuwHJeXFcd9dzFSFbPoD+f5kINThcXzrnnA5rKEKnYxeTiIgUR4Hv2Omp6rWr jvJ3sFLzT7cAF5kYDQtBdiF+K/JU4AYeFJ9Q8XRo= Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayfre-01.paragon-software.com (Postfix) with ESMTPS id 9B4441D45; Tue, 26 Sep 2023 09:57:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1695722259; bh=s8rZE6xcXKLHN8Ppy7AnwtG+R/usQmbqqKjeBuQwDZY=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=k2j+Lznppxo8BnNnw8gXtJjteGBTL1nm9pTMCmJptbhGLpSsJj26Gx+TzdfQrC9RI eOS0UGpEdLfWQJC9SluMmDby71fahpUEX9I3L7zWFCsep/GTylbiwKZSYvrfuwW1Pl Yy1CN7MyAIBSIbAbhHgBZzpi17B4YQdBFf14nOQI= Received: from [172.16.192.129] (192.168.211.137) by vdlg-exch-02.paragon-software.com (172.30.1.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Tue, 26 Sep 2023 12:57:39 +0300 Message-ID: Date: Tue, 26 Sep 2023 12:57:39 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 8/8] fs/ntfs3: Fix NULL pointer dereference on error in attr_allocate_frame() Content-Language: en-US From: Konstantin Komarovc To: CC: , References: <7c217d7d-6ee4-4603-b5f1-ebe7b68cf430@paragon-software.com> In-Reply-To: <7c217d7d-6ee4-4603-b5f1-ebe7b68cf430@paragon-software.com> X-Originating-IP: [192.168.211.137] X-ClientProxiedBy: vdlg-exch-02.paragon-software.com (172.30.1.105) To vdlg-exch-02.paragon-software.com (172.30.1.105) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 26 Sep 2023 02:58:05 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778108757822116569 X-GMAIL-MSGID: 1778108757822116569 Signed-off-by: Konstantin Komarov ---  fs/ntfs3/attrib.c | 6 ++----  1 file changed, 2 insertions(+), 4 deletions(-)              le = le_b; diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c index e16487764282..63f70259edc0 100644 --- a/fs/ntfs3/attrib.c +++ b/fs/ntfs3/attrib.c @@ -1736,10 +1736,8 @@ int attr_allocate_frame(struct ntfs_inode *ni, CLST frame, size_t compr_size,              le_b = NULL;              attr_b = ni_find_attr(ni, NULL, &le_b, ATTR_DATA, NULL,                            0, NULL, &mi_b); -            if (!attr_b) { -                err = -ENOENT; -                goto out; -            } +            if (!attr_b) +                return -ENOENT;              attr = attr_b;