[08/16] fs/ntfs3: Fix detected field-spanning write (size 8) of single field "le->name"
Message ID | 61494224-68a8-431b-ba76-46b4812c241c@paragon-software.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4170979vqy; Wed, 6 Dec 2023 07:12:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IEdhvsa7NELXJGm9IAd5TOqtPvXRkL0asxxVT/FR5YHSp3+PitmmURqbYKSWtXMhoLT7i07 X-Received: by 2002:a05:6a20:840e:b0:18f:97c:8a29 with SMTP id c14-20020a056a20840e00b0018f097c8a29mr1396461pzd.84.1701875562116; Wed, 06 Dec 2023 07:12:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701875562; cv=none; d=google.com; s=arc-20160816; b=NBLxdxJsUMi7y3vfjqPmlNu2kqyq2SSX8RR1w/irquTVMgytR0JaL0DJCYZSbg4pry N7l4DWaRpfOmY0R29hg4skHyBO2STRPaIZMegFUZY3HxDTSV/tl8VniDtt19SMXfC4Ac 0/EZe2VvKlcLol7IulIE2LeSxndTCmUKvzYhLaNfZQE66jRlTdAUrAukAbhDdhaAuCBv 2zeuO9bW9CpCsfhX8YS/IM0QwHBg0S20aFzt4FfTwawG5rxFJi2SsGn1RFMctiBs9v0S pZ9yx17yy6bccJH1jgPAfaAHwqWLkF9mfMLJnIBk/thccccV+hcdBd65nESU37WGURZj 8Abg== 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=oUVQuELufd+5uJnO89HaHyCbduYubrq21BOGdkAjVXA=; fh=P7I85FIabZcM8ojWdeG8ABpTZepe/Xtte9jKWDfUHBM=; b=Q/Tm0mGcrbSticf3wjMcFBylSJOZmWs20g/g095xY+oZpPsDaTlP6HIKPDMcbI4n8i gfpRCc7e0zB6tKW5uW14MmBcuyNrpIgfldbG0GisKbMkUZL94LZWlhBX+UmZd5qpmyxk ef8bhy2eQcYH9H2O1r5gWU0Xxr2l8R5vzGSSc9i9sZw5SranA/372BkgN3qcAu2HjrnP xsu1WCdCOSJUXHEg4n1cEqIlzyqQ3Ual75lP/bYe7KOi68e1Yz8qtYJb+2r+rkjjnrun A3KnQcms/0q0/vMbLfJdgljOQZsQzejrERF19oq9CJD28pN21wkElqMthgxGgL2w1ZOu kSow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=FOwzIfud; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id bw10-20020a056a00408a00b006cb901a87c4si78796pfb.376.2023.12.06.07.12.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 07:12:42 -0800 (PST) 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=@paragon-software.com header.s=mail header.b=FOwzIfud; 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=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 pete.vger.email (Postfix) with ESMTP id 2B64181BFCFC; Wed, 6 Dec 2023 07:12:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379226AbjLFPM3 (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Wed, 6 Dec 2023 10:12:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379228AbjLFPM1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 6 Dec 2023 10:12:27 -0500 Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AACBD7F; Wed, 6 Dec 2023 07:12:26 -0800 (PST) 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 0ECBE1E1A; Wed, 6 Dec 2023 15:06:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1701875160; bh=oUVQuELufd+5uJnO89HaHyCbduYubrq21BOGdkAjVXA=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=FOwzIfudC9bkRwbf6E0CtzufD/ejcjuSxV7Z5x/uEjKnx7LMxtYMRpGMY3a0f+Xj1 VTN9Wid82R80TU43j6P6Id0vICyjWksAudOq7xKWIgihy04fyxDrpW81CcbUOoqSiM 4rGdNcNiGvt9vbbsKkj/CzhrpECl0PL2b3/cdjq8= Received: from [172.16.192.129] (192.168.211.144) 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; Wed, 6 Dec 2023 18:12:23 +0300 Message-ID: <61494224-68a8-431b-ba76-46b4812c241c@paragon-software.com> Date: Wed, 6 Dec 2023 18:12:23 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 08/16] fs/ntfs3: Fix detected field-spanning write (size 8) of single field "le->name" Content-Language: en-US From: Konstantin Komarovc <almaz.alexandrovich@paragon-software.com> To: <ntfs3@lists.linux.dev> CC: <linux-kernel@vger.kernel.org>, <linux-fsdevel@vger.kernel.org> References: <00fd1558-fda5-421b-be43-7de69e32cb4e@paragon-software.com> In-Reply-To: <00fd1558-fda5-421b-be43-7de69e32cb4e@paragon-software.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [192.168.211.144] X-ClientProxiedBy: vobn-exch-01.paragon-software.com (172.30.72.13) 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,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> 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]); Wed, 06 Dec 2023 07:12:38 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784545869817779142 X-GMAIL-MSGID: 1784545869817779142 |
Series |
fs/ntfs3: Bugfix and refactoring
|
|
Commit Message
Konstantin Komarov
Dec. 6, 2023, 3:12 p.m. UTC
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
---
fs/ntfs3/ntfs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
}; // sizeof(0x20)
Comments
Hi Konstantin, On Wed, Dec 6, 2023 at 4:12 PM Konstantin Komarovc <almaz.alexandrovich@paragon-software.com> wrote: > Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com> Thanks for your patch, which is now commit d155617006ebc172 ("fs/ntfs3: Fix detected field-spanning write (size 8) of single field "le->name"") in next-20231207. > --- a/fs/ntfs3/ntfs.h > +++ b/fs/ntfs3/ntfs.h > @@ -523,7 +523,7 @@ struct ATTR_LIST_ENTRY { > __le64 vcn; // 0x08: Starting VCN of this attribute. > struct MFT_REF ref; // 0x10: MFT record number with attribute. > __le16 id; // 0x18: struct ATTRIB ID. > - __le16 name[3]; // 0x1A: Just to align. To get real name can > use bNameOffset. > + __le16 name[]; // 0x1A: Just to align. To get real name can > use name_off. noreply@ellerman.id.au reports for all m68k configs[1]: include/linux/build_bug.h:78:41: error: static assertion failed: "sizeof(struct ATTR_LIST_ENTRY) == 0x20" > > }; // sizeof(0x20) Indeed, we now have a hole of 4 bytes at the end of the structure, which shrinks the size of the structure on all architectures where alignof(u64) < sizeof(u64). So either the patch should be reverted, or explicit padding should be added. Your patch description is not very descriptive, so I don't know which is the correct solution. [1] http://kisskb.ellerman.id.au/kisskb/head/8e00ce02066e8f6f1ad5eab49a2ede7bf7a5ef64 Gr{oetje,eeting}s, Geert
diff --git a/fs/ntfs3/ntfs.h b/fs/ntfs3/ntfs.h index 86aecbb01a92..13e96fc63dae 100644 --- a/fs/ntfs3/ntfs.h +++ b/fs/ntfs3/ntfs.h @@ -523,7 +523,7 @@ struct ATTR_LIST_ENTRY { __le64 vcn; // 0x08: Starting VCN of this attribute. struct MFT_REF ref; // 0x10: MFT record number with attribute. __le16 id; // 0x18: struct ATTRIB ID. - __le16 name[3]; // 0x1A: Just to align. To get real name can use bNameOffset. + __le16 name[]; // 0x1A: Just to align. To get real name can use name_off.