From: Kees Cook <kees@kernel.org>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
Ian Rogers <irogers@google.com>
Cc: Greg KH <greg@kroah.com>, Miguel Ojeda <ojeda@kernel.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
linux-fsdevel@vger.kernel.org, llvm@lists.linux.dev,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH 2/2] seq_file: Require explicit initialization of struct seq_operations
Date: Thu, 15 Oct 2026 13:07:41 -0700 [thread overview]
Message-ID: <202610151304.AA5EC855@keescook> (raw)
In-Reply-To: <CANiq72=wS5NJyeKKaYiHKWhDq2Wjk728qkCUNq4xVoHrPEPCRw@mail.gmail.com>
On Thu, Oct 15, 2026 at 09:47:34AM +0200, Miguel Ojeda wrote:
> On Thu, Oct 15, 2026 at 9:11 AM Greg KH <greg@kroah.com> wrote:
> >
> > __must_init might be smaller?
>
> That sounds fine too. I like that it says that something *has* to be
> done (like the original name did). Hmm... On the other hand, I guess
> "must" could sound like one has to initialize the field "somehow",
> i.e. writing:
>
> struct S s = {};
>
> definitely initializes it, yet the compiler would warn. Would
> "explicit" hint a bit more at the fact that one has to actually
> "write" the field, even if it may have been initialized anyway?
>
> (Of course, if one knows that the attribute only applies to fields,
> then it doesn't make much of a difference)
Hmm, I just noticed Clang isn't diagnosing for file-scoped definitions.
I've opened: https://github.com/llvm/llvm-project/issues/232483
Do we want to wait on this attribute until Clang has full coverage for
all initializer cases, or land the attribute so we can continue to add
coverage for function-level coverage? I'm worried about a compiler bump
(once the bug is fixed) suddenly exposing a bunch of missed
initializers, but then again we also have no users yet...
-Kees
--
Kees Cook
next prev parent reply other threads:[~2026-10-15 20:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 22:58 [PATCH 0/2] Add __require_explicit_initialization and its first user Kees Cook
2026-10-14 22:58 ` [PATCH 2/2] seq_file: Require explicit initialization of struct seq_operations Kees Cook
2026-10-15 5:21 ` Greg KH
2026-10-15 5:46 ` Miguel Ojeda
2026-10-15 5:57 ` Kees Cook
2026-10-15 7:11 ` Greg KH
2026-10-15 7:47 ` Miguel Ojeda
2026-10-15 8:47 ` Greg KH
2026-10-15 22:29 ` Ian Rogers
2026-10-15 20:07 ` Kees Cook [this message]
2026-10-15 20:47 ` Nick Desaulniers
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=202610151304.AA5EC855@keescook \
--to=kees@kernel.org \
--cc=brauner@kernel.org \
--cc=greg@kroah.com \
--cc=irogers@google.com \
--cc=jack@suse.cz \
--cc=justinstitt@google.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=ojeda@kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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