Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5476134rwb; Tue, 17 Jan 2023 14:28:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXsSzUFXbdh84YJ8QOk9lDF7eSrjVnwzi12KSwo7F6RneVG7w3MYV1S6JbG5Fvo289eGyKHi X-Received: by 2002:a17:906:9710:b0:7c1:e7a:62e6 with SMTP id k16-20020a170906971000b007c10e7a62e6mr5126035ejx.71.1673994491714; Tue, 17 Jan 2023 14:28:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673994491; cv=none; d=google.com; s=arc-20160816; b=kI5PBKXtj0XBiai8lmBr+HV4TH6hweNaQr7jhMWmOHOn5CsMcHGgr44hGJBRaonI8r FDBozIAoCI0FhxhwugHy5F+rJMBJUSv7axSxrIUR6BtVpHklKbW9KDpY1YwOzCYtZhgE V2zE6ECEebK4QEBT1VSgcbVz2L61xRycyvNsGFP84qeVrCryjK8MmO1h+T7whU/XJoKP PqeLb1xOFLpzocYPP4ovih/WSeREFnskq50XFWWI8iL7cFFymEg+HQS6kdTKxG8p4w2A WFJ1VYFwocjJckqusQ98HANI/xYpug/KxIh4Sx2L3e9TK1sH+GMUT/CzlT3pDKtUDua7 T33g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=ICCYg7OREP6oV67uXWZcp5GV7AQTHIuTDP//cQYGqlw=; b=aic21F9giX0qeCNxhQa7N1jMQgGnyQDsAtRNj+YWL/7JR6GvKLD9aaXQbmM0O/TXTn RFhPwcCX31lBYul2ALG0xKUzPjGwTKSqgHc9g6teHn7j1thcI2ft+UTypP6mb8qEMTEC pWnd2U+pRBhluagvyLO2rgPth+OAhgfMGY0uzIcOmO2ChUkH310kyPlEHFsw/4tjeNu4 +hXSwU3UGxd+09XBO3SL4+c3Z7TmBlxQiOmtLxEqph0yX7MF/u4rHqblT0MPsYChgDE/ GaBFkuL7juYEqckO1MajKNhbWf20IMbYQqLahbJcUZ6i5tS/INVZQdwCeR9JXrtfd4Gg SfNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=GFVJkIWu; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w19-20020a170906b19300b0084d3497942esi26162354ejy.331.2023.01.17.14.28.00; Tue, 17 Jan 2023 14:28:11 -0800 (PST) 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=fail header.i=@kernel.org header.s=k20201202 header.b=GFVJkIWu; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229854AbjAQWJU (ORCPT + 46 others); Tue, 17 Jan 2023 17:09:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230019AbjAQWII (ORCPT ); Tue, 17 Jan 2023 17:08:08 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95EF83EC60; Tue, 17 Jan 2023 12:27:08 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id AA2386149D; Tue, 17 Jan 2023 20:27:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 813B8C433D2; Tue, 17 Jan 2023 20:27:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673987227; bh=r9S6GWZqtO98hixUabotCT9dNXxS/dfJjaNPyn+TipQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GFVJkIWukAG/4hoH/KvZs1ZQX+Zfk3eG87ciZxJV28q30TpQSOnHiD5UzNGHsM8vJ dCgAxI2DS//fuL/AUEzCMojb+ZuOQx/AyJ4WD0uEfHlsnTKAhp82GPQToeqo0Omxqp LcBIztjH6A14n+zmaxHTPGU5U1IoLJ3yT2qHMBevRez43e1IzTnTcDGEiwoo+dnrR9 nvZhL8zLdFf1SaJ3D/NfzC453F3ntM3qHj1D8c1L3AgelNFKyN41rxjT6u8Om2hnX9 fqzc0xW0Oa+Dexu8dXccc12ymY+8Ac2L8aIEARur4r6sleV+JhlFlVkgDK1bDX/rGa XraAFntf7vGGA== From: SeongJae Park Cc: Alon Zahavi , almaz.alexandrovich@paragon-software.com, ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org, Tal Lossos , stable@vger.kernel.org, gregkh@linuxfoundation.org Subject: Re: [PATCH] ntfs3: Fix attr_punch_hole() null pointer derenference Date: Tue, 17 Jan 2023 20:27:03 +0000 Message-Id: <20230117202703.116897-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220815110712.36982-1-zahavi.alon@gmail.com> References: MIME-Version: 1.0 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Mon, 15 Aug 2022 14:07:12 +0300 Alon Zahavi wrote: > From: Alon Zahavi > > The bug occours due to a misuse of `attr` variable instead of `attr_b`. > `attr` is being initialized as NULL, then being derenfernced > as `attr->res.data_size`. > > This bug causes a crash of the ntfs3 driver itself, > If compiled directly to the kernel, it crashes the whole system. > > Signed-off-by: Alon Zahavi > Co-developed-by: Tal Lossos > Signed-off-by: Tal Lossos This patch has now merged in mainline as 6d5c9e79b726cc473d40e9cb60976dbe8e669624. stable@, could you please merge this in stable kernels? Fixes: be71b5cba2e64 ("fs/ntfs3: Add attrib operations") # 5.14 Thanks, SJ > --- > fs/ntfs3/attrib.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c > index e8c00dda42ad..4e74bc8f01ed 100644 > --- a/fs/ntfs3/attrib.c > +++ b/fs/ntfs3/attrib.c > @@ -1949,7 +1949,7 @@ int attr_punch_hole(struct ntfs_inode *ni, u64 vbo, u64 bytes, u32 *frame_size) > return -ENOENT; > > if (!attr_b->non_res) { > - u32 data_size = le32_to_cpu(attr->res.data_size); > + u32 data_size = le32_to_cpu(attr_b->res.data_size); > u32 from, to; > > if (vbo > data_size) > -- > 2.25.1 > >