From patchwork Thu Dec 7 14:28:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 175185 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4824951vqy; Thu, 7 Dec 2023 06:38:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IGyu5OSfLKdfahdUXzGE2HFMJ503C5ueGv245uzay/7yBaurMxb0+kcwymXX+tVrg/NM/B9 X-Received: by 2002:a05:6a00:5c:b0:6ce:2732:1dee with SMTP id i28-20020a056a00005c00b006ce27321deemr2556084pfk.40.1701959908060; Thu, 07 Dec 2023 06:38:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701959908; cv=none; d=google.com; s=arc-20160816; b=KbLCvDw2fijV4+BzISbSU+iIPwDnjQIjqb30OIFiRrghRiiKBPSFAmZrd30op7qyBc +y3G3N636CO+o5CbdDa/KYiHzDHseRVtc+eCF6MjdSv+dUz4/2qphmXX0dppM4bPKzdW x6Y/MbnpJX6mKaXVRqtBif4GjnEdbkemKp/FtiN1IZ7yEM4GyFv0+Bp8nMJZLybZyKAv DP+nr15EyqSYB+NomvqdKyPts9G7hdxjZeOD/UIg6fyJm1QHLi0ciSshFdgTicQ9kJ5r a0BmxLV8xxjZ9YHOMaIViXLGxsetn1umcfonfS9fkMylr8naQA997LP+c+zAnJHOYfNN i0ew== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=0PlPZbtdJTHIRLyCbkuLSfJ/YGXVRKH/GD5nx+Ho1sU=; fh=PJrgtJW/RNK0kY0xt7y5xSZxWjgbZvfhIuMUDW2oLBA=; b=vHVpPrzD0Ax6sB+RVvg6KVMlPjBi9+bUJEhs+68jHSTq8sXTMmK396mS4nDInxkdCb 3I/9pMgqA7Q9jhtqjG6tu2+itHHJPtn1vCy0FU7WWGBNBZt40LAvp8TG7K1qYxurjHUt KpkSmuuM9u4J5SFu99hmMtP6fzZHMZv3XTYNVyjjVdhal91HncSUC7ezVPjGXLyV4QcD AcyKGew7If4W0365CBGyiKPMMYGpST1vXfH5LBn1Qf+Hya0/l3k4pq/xJ4pohCbbAdAK Cgd/ufPfHRZBuXSErYwDv7y9zF7Skpr71gqexM8VLsMkNohN2VOh6jHcXs6UERsdruYM 33OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KvEIWJL0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id s14-20020a65644e000000b00565f0e91894si1239421pgv.394.2023.12.07.06.38.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 06:38:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KvEIWJL0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id C5F99801F800; Thu, 7 Dec 2023 06:38:25 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443323AbjLGOiL (ORCPT + 99 others); Thu, 7 Dec 2023 09:38:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443327AbjLGOiH (ORCPT ); Thu, 7 Dec 2023 09:38:07 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0A7019AE for ; Thu, 7 Dec 2023 06:28:43 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7050EC433CA; Thu, 7 Dec 2023 14:28:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701959323; bh=D9nxTK7jFnq47guRUf7p0EWjiyZ4kSvltCqz6c9gFdQ=; h=From:To:Cc:Subject:Date:From; b=KvEIWJL0c28wOt6hHBfKl/PFvX4I9W4q4j9VYbk0kxQJe491uZumXJkhX1i+r+GP8 I2wilQK7faBB+VJvr4Mf1o18lHzl91ZlF4S/QNwi5wBrCnIkXqZ1z5eaKTCAeMbtQ3 yKh15zRX8v4GluMOVq5OlO5/SUneBNqaM6oLysbbs8aCucer28/qUTOVfkgIrtG53E CGuEXOGbGCnS6XveR81TVTler4TIgA3i6XQBk0PHEERImbffH+FK7d2wKTBWHzVgNo b6u+j0IUV4pkhj/c3Sp5WOn0ONwHhLnu4HQjguo7SMxUhHCamvFx8vHuQHSjTWoxL8 e7WPw3726v4rQ== From: Arnd Bergmann To: Konstantin Komarov Cc: Arnd Bergmann , ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] ntfs3: align struct ATTR_LIST_ENTRY Date: Thu, 7 Dec 2023 15:28:34 +0100 Message-Id: <20231207142838.960725-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 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,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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 07 Dec 2023 06:38:25 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784634312785652608 X-GMAIL-MSGID: 1784634312785652608 From: Arnd Bergmann On architectures like i386 that don't enforce natural alignment of u64 struct members, so the recent change to remove the final 48 bits reduced the structure size from 32 to 28 bytes: include/linux/build_bug.h:78:41: error: static assertion failed: "sizeof(struct ATTR_LIST_ENTRY) == 0x20" fs/ntfs3/ntfs.h:530:1: note: in expansion of macro 'static_assert' 530 | static_assert(sizeof(struct ATTR_LIST_ENTRY) == 0x20); | ^~~~~~~~~~~~~ Add an alignment attribute that makes the structure the same across all architectures again. Fixes: d155617006eb ("fs/ntfs3: Fix detected field-spanning write (size 8) of single field "le->name"") Signed-off-by: Arnd Bergmann Acked-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested --- fs/ntfs3/ntfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ntfs3/ntfs.h b/fs/ntfs3/ntfs.h index c8981429c721..2d409ac94cbb 100644 --- a/fs/ntfs3/ntfs.h +++ b/fs/ntfs3/ntfs.h @@ -525,7 +525,7 @@ struct ATTR_LIST_ENTRY { __le16 id; // 0x18: struct ATTRIB ID. __le16 name[]; // 0x1A: To get real name use name_off. -}; // sizeof(0x20) +} __aligned((8)); // sizeof(0x20) static_assert(sizeof(struct ATTR_LIST_ENTRY) == 0x20);