[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <75623e39-14da-4e4d-8129-790ed08b66ae@app.fastmail.com>
Date: Sat, 21 Jun 2025 11:21:09 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Simon Horman" <horms@...nel.org>, "Arnd Bergmann" <arnd@...nel.org>
Cc: "Andrew Lunn" <andrew+netdev@...n.ch>,
"David S . Miller" <davem@...emloft.net>,
"Eric Dumazet" <edumazet@...gle.com>, "Jakub Kicinski" <kuba@...nel.org>,
"Paolo Abeni" <pabeni@...hat.com>, "Thomas Gleixner" <tglx@...utronix.de>,
"Ingo Molnar" <mingo@...nel.org>, Netdev <netdev@...r.kernel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] myri10ge: avoid uninitialized variable use
On Sat, Jun 21, 2025, at 09:49, Simon Horman wrote:
> On Fri, Jun 20, 2025 at 01:26:28PM +0200, Arnd Bergmann wrote:
>>
>> It would be nice to understand how to make other compilers catch this as
>> well, but for the moment I'll just shut up the warning by fixing the
>> undefined behavior in this driver.
>>
>> Signed-off-by: Arnd Bergmann <arnd@...db.de>
>
> Hi Arnd,
>
> That is a lovely mess.
>
> Curiously I was not able to reproduce this on s390 with gcc 10.5.0.
> Perhaps I needed to try harder. Or perhaps the detection is specific to a
> very narrow set of GCC versions.
I was using my gcc binaries from
https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/arm64/10.5.0/
but more likely this is kernel configuration specific than the exact
toolchain version.
The warning clearly depends on the myri10ge_send_cmd() function getting
inlined into the caller, and inlining is highly configuration specific.
See https://pastebin.com/T23wHkCx for the .config I used to produce
this.
> Regardless I agree with your analysis, but I wonder if the following is
> also needed so that .data0, 1 and 2 are always initialised when used.
Right, I stopped adding initializations when all the warnings were
gone, so I missed the ones you found. ;-)
I've integrated your changes now, let me know if I should resend it
right away, or you want to play around with that .config some more
first and reproduce the warning.
Arnd
Powered by blists - more mailing lists