Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2422164rdh; Sun, 29 Oct 2023 15:55:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJ3Imr6XVq8RTtq+x17eCt4ySnrxSuziUrFus/H2js0sUNWu6m2HbnnaWdAneGqy6F4Bja X-Received: by 2002:a05:6871:3428:b0:1e9:b860:96df with SMTP id nh40-20020a056871342800b001e9b86096dfmr11671680oac.7.1698620132194; Sun, 29 Oct 2023 15:55:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698620132; cv=none; d=google.com; s=arc-20160816; b=FYcUGD+2doBglvQ58Mxex3UvUlCkmdJe5pq6UIWekVhScuZer6Bz7JtOgRdV6ZJwD2 Jqo6Zcv3GYGDi0WfR7QEuZAAe7zKvyU1wHpQJURwJg8LLEEzAijv0A8roFOaj+Gru0S8 PlTQwyi7Zhv7nqZ36FQooUUF5JTW7K/jPyUTyHTxlrK7+K2+gauVCIIyOcUM5YW3Nah9 nNWx8GpUN1qgi6Ib9XOMvg5QRmUkmwxOfDNVYlR05PqQBLIURF7O3n8aG1pcZPhdr457 i4Pvdsujz/FQB/lWeMOSMWLdLsmyBRRp9/rdorr3cwE+nNFIvBbmX3wUt0vQcOu6T38K AY+Q== 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=+RjW8xr9yNJ3E6mrz7/NjfxIa9H1JKztIkE3SEil7Fc=; fh=IVcZYgopwke+Bc9cmwdOT5yAIhnLPNAsBqE9TuY8J+c=; b=qduqPKfxrVjHAXObVAwO5cNHoyDdWoiGTDDgJO848jIYllJGzkOike3FMb62cebhSl /iwIN0zUBevH7MhdPnTFpVS5r6SmfRNUtlqnL8Bf6nckbwwpnjGeYudR5wNx5m0J8HH1 LtvYXm010yYnVXF/bMGbxt4Pp3Jvy0lrNz/gZFpS1iaRmBKjMG8sUW3bCVuLxEEjnJNL euEmiqww3D5UXwApciteSBEpcEndv2PYmwbTruFEYR71gkJKvBlyicWBTBG0jM42PQ0K U/EjxCPVDcjk1G3f7dgUF3Tpi7wj9hiwGddtW9yTbZyNCoerdeloH1MtWmTkTZWGtPw8 nDSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ftYWzWF5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id k184-20020a6384c1000000b005b960674526si2516561pgd.779.2023.10.29.15.55.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 15:55:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ftYWzWF5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 4268B80ACB62; Sun, 29 Oct 2023 15:55:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231262AbjJ2WzZ (ORCPT + 99 others); Sun, 29 Oct 2023 18:55:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231183AbjJ2WzH (ORCPT ); Sun, 29 Oct 2023 18:55:07 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5597FF; Sun, 29 Oct 2023 15:54:59 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28FE1C433C7; Sun, 29 Oct 2023 22:54:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698620099; bh=3ecTuxaFxXd+4WzH7yZUfyWhqhdE2zoYnEaqwcm2F1Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ftYWzWF5NlFV5fa/Hii9tnMigbGoXy2nl3p9xaX0MNuxgGhDXt9fVRtyf9UzO17mT olwFHYtw+eujgLigw40G5lBA9qEstS0RAAGrYbMpXPSv4mkJJETf7oVmZO/7TqMZpI HvQFLxqeLOddUp+aPeG6pshpkjwS8QE9UYQoOLbdQgIyN1x3XmqMpfQe61KTyn2RlI P8RlNZmUEIWACjJ5FAfxjNZoQw7CE8yqUzHkFlQKrQ7vGQK8CrNUwF1h/RYtjse647 RoKdXUWYN2d2/EWZAt1/v3bUDqaBDkCxMDwWCT9a6WQp00/baqvw+gpXNwn5Zmb/8U BmxzRlUB2jKXw== 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 11/52] fs/ntfs3: Fix possible NULL-ptr-deref in ni_readpage_cmpr() Date: Sun, 29 Oct 2023 18:52:58 -0400 Message-ID: <20231029225441.789781-11-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=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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 (snail.vger.email [0.0.0.0]); Sun, 29 Oct 2023 15:55:31 -0700 (PDT) From: Konstantin Komarov [ Upstream commit 32e9212256b88f35466642f9c939bb40cfb2c2de ] Signed-off-by: Konstantin Komarov Signed-off-by: Sasha Levin --- fs/ntfs3/frecord.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c index 8f34d6472ddbd..05fb3dbe39076 100644 --- a/fs/ntfs3/frecord.c +++ b/fs/ntfs3/frecord.c @@ -2148,7 +2148,7 @@ int ni_readpage_cmpr(struct ntfs_inode *ni, struct page *page) for (i = 0; i < pages_per_frame; i++) { pg = pages[i]; - if (i == idx) + if (i == idx || !pg) continue; unlock_page(pg); put_page(pg); -- 2.42.0