From patchwork Tue Sep 26 09:57:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Konstantin Komarov X-Patchwork-Id: 144867 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp1875690vqu; Tue, 26 Sep 2023 05:33:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG4tgXpRYBfGjCQrAPvbaB2yPVzeW9BBAU48WYdaNHWFy45oIQzrtga3vLaukysCVsEJDfq X-Received: by 2002:a05:6358:798:b0:144:9cef:cd28 with SMTP id n24-20020a056358079800b001449cefcd28mr9300061rwj.7.1695731624713; Tue, 26 Sep 2023 05:33:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695731624; cv=none; d=google.com; s=arc-20160816; b=pwKywoSqRpM9S7ZYsOcXAY8DWEZYMCmNziXiL1kEePxGgDYE+6NuD25xU9cfRjJoMA 1r4MNn0zZCX9ZG4f8KZPAFDPULB3kFCW7O/VnjgqYuxA2t3jbvOBW9otbNKUltzEkGkb WQyU5qOTAy9oJpsUEZA15DuTPAFeJctNCXxaOCQB4ldCLtOnFiTb1ecvvRhh0JrPsYVG PXdzGoKgzVfpSPWtVonoeQn8qcxa65SddG+S70HdlmD94M3mMpUfY19ZHQvvVTIRZ8F2 pD6Ase0QUQp3ip2orBg+rVvSyBIstMb7t/F0EwFO75UusTLMLKGH+iqkBpGtPxujfzmH mUmg== 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; bh=bm/OuTb2k1SKktIcvNOfnXcU6zkoYgiSC7bYVh+F8wM=; fh=P7I85FIabZcM8ojWdeG8ABpTZepe/Xtte9jKWDfUHBM=; b=cuX13L3R8WehqzoVQ+LnTkWC4w8JmmLhKSlWK1qrSbdnjsC+T2ry50ZePcv1AyhQ2W 9ZqYClNi9I7qPGDfhx/9ur/41g5oAB9+PH/Sgca3CAfO7ZyxP9bp33jc7ihEiVnw4S+k sfAvleluqvhBrnIuFpN9LXMPxCbf1QUWaAl6ahrY6T8BJj0pNkhfu1xZ6Msc1buQhmmw eXuwN45pFDFIQB5cwwxW5laFLC/ssC1QvU+kZ/3MK5H14N9ogAUX3lcsSq+F/ZslQaL+ InaCJkbO/K4wF4uT8fpJ2v0Zo0WK7h1oWWqOnzB8AaKFLraXeaZjDVzEDItBWTtWTdnP xG/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=LFKbUDez; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id g37-20020a631125000000b00578e7a37c45si12511436pgl.10.2023.09.26.05.33.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 05:33:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=LFKbUDez; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 69D6C8056982; Tue, 26 Sep 2023 02:57:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234340AbjIZJ51 (ORCPT + 27 others); Tue, 26 Sep 2023 05:57:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234332AbjIZJ5X (ORCPT ); Tue, 26 Sep 2023 05:57:23 -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 7055E180; Tue, 26 Sep 2023 02:57:16 -0700 (PDT) Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id D74CD21BC; Tue, 26 Sep 2023 09:51:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1695721883; bh=bm/OuTb2k1SKktIcvNOfnXcU6zkoYgiSC7bYVh+F8wM=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=LFKbUDezPewix3D97fm/Cu+G0YjuJU15KhAJ0g5GOkGfyPwZk35Rq51MGSp46698H ftYL9HxtU9bsc6ixQLJ/8BR9nwgZ0+V1O/VHVo5M65Vh4B2dDDGK0CXf+oaBCqT5dx E8AN+uc2Kx/Hz5PGxBz1iEuf606qJPfzRRHM2PT0= 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:13 +0300 Message-ID: Date: Tue, 26 Sep 2023 12:57:13 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 7/8] fs/ntfs3: Fix possible NULL-ptr-deref in ni_readpage_cmpr() 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=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 26 Sep 2023 02:57:38 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778103484184872024 X-GMAIL-MSGID: 1778103484184872024 Signed-off-by: Konstantin Komarov ---  fs/ntfs3/frecord.c | 2 +-  1 file changed, 1 insertion(+), 1 deletion(-)          put_page(pg); diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c index d49fbb22bd5e..dad976a68985 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);