Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2422297rdh; Sun, 29 Oct 2023 15:56:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEo8li1I8sXue4tLURwduFkneHCmQugZoKewEkxON3Mvn9IsvFOzBMz2moSAsbTjnsxND2V X-Received: by 2002:a05:6870:b17:b0:1bb:c0ee:5536 with SMTP id lh23-20020a0568700b1700b001bbc0ee5536mr12095941oab.47.1698620166207; Sun, 29 Oct 2023 15:56:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698620166; cv=none; d=google.com; s=arc-20160816; b=jB+FamKgM2+LzROaJvDQyYcc0Fj+Z1jmguBvjKPG/PtWNMOm6nZsqaOKMJPj2B7+OT qVMu7twmeXRT7v5AP44vMPlwLbVi+0S+dH6joOZCOCjmnR/qiHxtZ/A3Cd+L+894g7mm x/WuAYidRXom89JusaOO0u03bsipNG4K0r/JqxOJGCvbAPI/PLRwWdQp8T2t7Fu+lfI/ wSfxTl6+lA296Q+gVlYNUNumUBuGU4HC+uqeA1BJ2PtdjSFeTk6IvMRosEkrV2VKGmE5 04vB6JLT3eU6kGOWJ2DcnYRnAzSkgKUJhlf2k5kMyr1EnFWRxSemMjqiRgTmGYtWOa/X 4XOw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VNIsRAIHebPbr8OslTNBs1+1szu24u9YXbvvET6D4Rc=; fh=IVcZYgopwke+Bc9cmwdOT5yAIhnLPNAsBqE9TuY8J+c=; b=ad9/Hgct2iygYVYJiJ+T686I10qLoaaUxO2R42Rw9aCXGEQuDJXeGGM3oUjJSGwEwX BMaemIdxxZ8XkL253o3d2r7zFEeZeCjAXXCDy0gXoaWb+unA00p0j+dOb6lxp+8JfP9I sBTkJ8adbSlbKED4KfE0Kv+Bbs2OSDY1pJbmUR2y1Zq+IUNonYZ4b9bPvTFVPNW+wTkp KrUCnipT8+Ffv37YZe1nrXBm0MzPks4fIIRm4tgkV4JbNFVR8FBOBPHeYMOunoZaYww5 xJhRXoPTUugsZfPjo4pZ0yXf1UuLZESFwXk9ewzBtpH2c+ffi9KrOikbKsm7Vc6CGMOZ eLnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E2rGCCz2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id w191-20020a6382c8000000b005b7160263f2si2521875pgd.154.2023.10.29.15.56.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 15:56:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E2rGCCz2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B7F3D805DC43; Sun, 29 Oct 2023 15:55:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231270AbjJ2Wz3 (ORCPT + 99 others); Sun, 29 Oct 2023 18:55:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231207AbjJ2WzI (ORCPT ); Sun, 29 Oct 2023 18:55:08 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC21A107; Sun, 29 Oct 2023 15:55:00 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30B6AC433C9; Sun, 29 Oct 2023 22:55:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698620100; bh=AKxOtT3QqFrG69RF7cmdei0Apow5y+b6LogocDbTJdQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E2rGCCz2moVjbFZmJ+3sJPL1IS4AZ66umW1defuubCvOrWoKWk1fgUk2T5gvxRIM/ sU87LgxPU7/gnCesgAzoKa0zJhjxjDLL5XhTeNbG/L0oPYzylA7AOTmhWW9ZbF7LH1 jZdxoj3UKd6wGQu55CqQJzsTbg7X7QtvNnR2+9APpUepu65oSk05xKA9GJNFJBHCnd reyik3BoBqi46x6chQP0ReHDN4ut+15OX9n61QG9OaUAitXuFMCyrLMhd8hDKmWXXj Wp3HvdW7uxxZZJxLqdbhInEpUXkLIAB/ENL7XDi8uAEVgvatt8yeKyXOEzGCgOB4Ye 8JyFSpPymDv0Q== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Konstantin Komarov , Sasha Levin , ntfs3@lists.linux.dev Subject: [PATCH AUTOSEL 6.5 12/52] fs/ntfs3: Fix NULL pointer dereference on error in attr_allocate_frame() Date: Sun, 29 Oct 2023 18:52:59 -0400 Message-ID: <20231029225441.789781-12-sashal@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231029225441.789781-1-sashal@kernel.org> References: <20231029225441.789781-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.5.9 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Sun, 29 Oct 2023 15:55:53 -0700 (PDT) From: Konstantin Komarov [ Upstream commit 9c689c8dc86f8ca99bf91c05f24c8bab38fe7d5f ] Signed-off-by: Konstantin Komarov Signed-off-by: Sasha Levin --- fs/ntfs3/attrib.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c index a9d82bbb4729e..0b52bc9681085 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; le = le_b; -- 2.42.0