lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c3c28d70-540b-4034-8a89-8a6c4dcf17ab@embeddedor.com>
Date: Tue, 25 Feb 2025 12:21:15 +1030
From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To: Christoph Hellwig <hch@....de>,
 "Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc: Sagi Grimberg <sagi@...mberg.me>, Chaitanya Kulkarni <kch@...dia.com>,
 linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org,
 linux-hardening@...r.kernel.org
Subject: Re: [PATCH 6/8][next] nvme: target: Avoid
 -Wflex-array-member-not-at-end warnings



On 25/02/25 00:49, Christoph Hellwig wrote:
> On Mon, Feb 24, 2025 at 08:30:10PM +1030, 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.
>>
>> Change the type of the middle struct members currently causing trouble
>> from `struct bio` to `struct bio_hdr`.
>>
>> We also use `container_of()` whenever we need to retrieve a pointer to
>> the flexible structure `struct bio`, through which we can access the
>> flexible-array member in it, if necessary.
>>
>> With these changes fix 38 of the following warnings:
>>
>> drivers/nvme/target/nvmet.h:455:49: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
>> drivers/nvme/target/nvmet.h:462:49: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
>>
> 
> I'm not sure where you bio_hdr structure comes from, but maybe that's
> because you annoyingly split CC over the series, and by the number of
> patches probably also bundled unrelated changes.

Ugh, yes, I messed up my script just before creating the series.

> 
> In general our first resort here should be to move embedded bio to the
> of containing structures.  If that's not possible you'll need to explain
> why.
> 

Yes. Also, thanks for the feedback in your other response. I'll try to
follow that approach and see how it goes.

--
Gustavo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ