[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <685c91a8c3ed5_1608bd10024@dwillia2-xfh.jf.intel.com.notmuch>
Date: Wed, 25 Jun 2025 17:17:44 -0700
From: <dan.j.williams@...el.com>
To: "Gustavo A. R. Silva" <gustavoars@...nel.org>, Kees Cook
<kees@...nel.org>, Dan Williams <dan.j.williams@...el.com>, Vishal Verma
<vishal.l.verma@...el.com>, Dave Jiang <dave.jiang@...el.com>, Ira Weiny
<ira.weiny@...el.com>, "Rafael J. Wysocki" <rafael@...nel.org>, Len Brown
<lenb@...nel.org>
CC: <nvdimm@...ts.linux.dev>, <linux-acpi@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, "Gustavo A. R. Silva"
<gustavoars@...nel.org>, <linux-hardening@...r.kernel.org>
Subject: Re: [PATCH v4][for-next/hardening] acpi: nfit: intel: avoid multiple
-Wflex-array-member-not-at-end warnings
Gustavo A. R. Silva wrote:
> -Wflex-array-member-not-at-end was introduced in GCC-14, and we are
> getting ready to enable it, globally.
>
> Use the new TRAILING_OVERLAP() helper to fix a dozen instances of
> the following type of warning:
>
> drivers/acpi/nfit/intel.c:692:35: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
>
> Acked-by: Dan Williams <dan.j.williams@...el.com>
> Tested-by: Dan Williams <dan.j.williams@...el.com>
Looks like our mails crossed [1], but I rushed this testing, apologies.
This patch does cause a regression, and the conversion is not equivalent
according to pahole:
union pkg_nd_intel_bus_fw_activate {
struct nd_cmd_pkg pkg; /* 0 64 */
struct {
u8 _offset_to_fam[64]; /* 0 64 */
/* --- cacheline 1 boundary (64 bytes) --- */
struct nd_intel_bus_fw_activate cmd; /* 64 5 */
} __attribute__((__packed__)); /* 0 69 */
};
struct pkg_nd_intel_bus_fw_activate2 {
struct nd_cmd_pkg pkg; /* 0 64 */
/* XXX last struct has a flexible array */
/* --- cacheline 1 boundary (64 bytes) --- */
struct nd_intel_bus_fw_activate cmd; /* 64 5 */
/* size: 72, cachelines: 2, members: 2 */
/* padding: 3 */
/* flexible array members: end: 1 */
/* last cacheline: 8 bytes */
};
Now, why the padding at the end matters for this test, I am still
trying to figure that out.
[1]: http://lore.kernel.org/685c772aa7cc1_23a2a10080@dwillia2-mobl4.notmuch
Powered by blists - more mailing lists