From: "Arnd Bergmann" <arnd@arndb.de>
To: "Marco Elver" <elver@google.com>
Cc: "Konstantin Komarov" <almaz.alexandrovich@paragon-software.com>,
"Dmitry Vyukov" <dvyukov@google.com>,
ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org,
kasan-dev@googlegroups.com
Subject: Re: kcsan -Wmaybe-uninitialized warning in ntfs3
Date: Wed, 22 Apr 2026 22:57:05 +0200 [thread overview]
Message-ID: <f6e38fc0-7732-42f4-90a3-5cd495440d1c@app.fastmail.com> (raw)
In-Reply-To: <CANpmjNN8J=cFnsQpj+_VXuoswsc500jRV=mKDBSntZw0Xvib4w@mail.gmail.com>
On Wed, Apr 22, 2026, at 10:23, Marco Elver wrote:
> On Wed, 22 Apr 2026 at 10:00, Arnd Bergmann <arnd@arndb.de> wrote:
>>
>> On Tue, Apr 21, 2026, at 21:12, Arnd Bergmann wrote:
>> > On Tue, Apr 21, 2026, at 21:06, Marco Elver wrote:
>> >> On Tue, 21 Apr 2026 at 17:26, Marco Elver <elver@google.com> wrote:
>> >> [...]
>> >>> > To me, 2 makes more sense. The attribute requires gcc-11 or higher,
>> >>> > so you need to wrap that in a compiler version specific macro,
>> >>> > but since I only saw the warning with gcc-12 and higher, that
>> >>> > should be fine.
>> >>
>> >> Kindly test if you can:
>> >> https://lore.kernel.org/all/20260421190351.1976329-1-elver@google.com/
>> >
>> > Applied to my randconfig tree and verified that this fixes the
>> > known warning (only one out of about 200 random configs). I'll
>> > let you know if something comes up by tomorrow.
>>
>> Unfortunately, there are new warnings after your patches using
>> gcc-11. In 500 randconfig builds with that compiler, I saw 7
>> configurations failing with one of these four messages:
>
> Looks like a compiler bug to me; can you check gcc-12+ ? Maybe we need
> to allow the __access attribute only for later GCC versions.
All gcc versions I tried that support kcsan run into some of
the warnings, but the exact set is not always the same.
The stringop-overread warnings are (like -Wmaybe-uninitialized)
a bit unpredictable and depend on the exact optimizations taken
by the compiler, to see exactly which object is passed into
a string operation and what its size is.
I'm guessing that by annotating a function argument as being
not accessed, gcc starts assuming that the object has zero
valid bytes if it cannot deduce the actual length in any
other way.
Arnd
next prev parent reply other threads:[~2026-04-22 20:57 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-21 7:53 Arnd Bergmann
2026-04-21 9:33 ` Marco Elver
2026-04-21 10:21 ` Arnd Bergmann
2026-04-21 11:35 ` Marco Elver
2026-04-21 12:28 ` Arnd Bergmann
2026-04-21 13:18 ` Marco Elver
2026-04-21 14:11 ` Arnd Bergmann
2026-04-21 15:26 ` Marco Elver
2026-04-21 19:06 ` Marco Elver
2026-04-21 19:12 ` Arnd Bergmann
2026-04-22 8:00 ` Arnd Bergmann
2026-04-22 8:23 ` Marco Elver
2026-04-22 11:35 ` Marco Elver
2026-04-22 11:51 ` Marco Elver
2026-04-22 20:57 ` Arnd Bergmann [this message]
2026-04-22 21:50 ` Marco Elver
2026-04-23 8:12 ` David Laight
2026-04-23 11:35 ` Marco Elver
2026-04-23 13:06 ` David Laight
2026-04-24 10:03 ` Marco Elver
2026-04-21 12:26 ` Marco Elver
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f6e38fc0-7732-42f4-90a3-5cd495440d1c@app.fastmail.com \
--to=arnd@arndb.de \
--cc=almaz.alexandrovich@paragon-software.com \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ntfs3@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®