From: Nathan Chancellor <nathan@kernel.org>
To: Kees Cook <kees@kernel.org>
Cc: ardb@kernel.org, Bill Wendling <morbo@google.com>,
gustavoars@kernel.org, ndesaulniers@google.com,
justinstitt@google.com, broonie@kernel.org, elver@google.com,
alan.maguire@oracle.com, namjain@linux.microsoft.com,
peterz@infradead.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH v4] compiler_types: Allow opting out of __counted_by and __counted_by_ptr
Date: Wed, 7 Oct 2026 11:09:15 +0200 [thread overview]
Message-ID: <20261007090915.GA1504630@ax162> (raw)
In-Reply-To: <202610060642.7C4125F@keescook>
On Tue, Oct 06, 2026 at 07:12:07AM -0700, Kees Cook wrote:
> And other architectures solve this problem by not wiping KBUILD_CFLAGS in
> the first place. :P So if we want to continue to accept the x86 exception
> (which I would argue is the actual problem), we likely need to, instead,
> construct an explicit export that is used to collect parsing control
> options so that it can be re-included here. Today, I can think of
> -fms-extensions besides -fexperimental-late-parse-attributes.
>
> KBUILD_PARSE_CFLAGS += -fms-extensions
> ...
> KBUILD_PARSE_CFLAGS += -fexperimental-late-parse-attributes
> ...
> export KBUILD_PARSE_CFLAGS
> KBUILD_CFLAGS += $(KBUILD_PARSE_CFLAGS)
> ...
>
> We already do something like this for CLANG_FLAGS, which, given
> -fexperimental-late-parse-attributes being Clang-specific, perhaps we
> ignore my -fms-extensions future-proofing, and just add it there, but
> it doesn't look like that is how scripts/Makefile.clang was intended to
> be used.
I agree that fixing the x86 efistub to mirror other architectures is the
right fix for this particular instance of the problem (as you note this
is not the first time this has bitten us). However, we may want to
consider adding '-fexperimental-late-parse-attributes' to
CC_FLAGS_DIALECT as well so that the many other places in the kernel
that blow away KBUILD_CFLAGS won't have similar problems if
__counted_by_ptr happens to be used there, as this type of solution
might not always be possible. We could rename it to CC_FLAGS_PARSE or
something like that but I am not sure it is strictly necessary.
--
Cheers,
Nathan
next prev parent reply other threads:[~2026-10-07 9:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 10:25 [PATCH] " Bill Wendling
2026-10-05 10:44 ` Justin Stitt
2026-10-05 10:53 ` Ard Biesheuvel
2026-10-05 15:52 ` Bill Wendling
2026-10-05 19:19 ` Bill Wendling
2026-10-05 19:20 ` [PATCH v3] " Bill Wendling
2026-10-05 21:25 ` Ard Biesheuvel
2026-10-06 7:30 ` Justin Stitt
2026-10-06 8:07 ` Ard Biesheuvel
2026-10-06 9:23 ` Bill Wendling
2026-10-06 9:43 ` [PATCH v4] " Bill Wendling
2026-10-06 10:08 ` Ard Biesheuvel
2026-10-06 13:46 ` Bill Wendling
2026-10-06 14:12 ` Kees Cook
2026-10-07 9:09 ` Nathan Chancellor [this message]
2026-10-07 9:32 ` Bill Wendling
2026-10-07 9:36 ` Nathan Chancellor
2026-10-06 13:45 ` [PATCH v5] " Bill Wendling
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=20261007090915.GA1504630@ax162 \
--to=nathan@kernel.org \
--cc=alan.maguire@oracle.com \
--cc=ardb@kernel.org \
--cc=broonie@kernel.org \
--cc=elver@google.com \
--cc=gustavoars@kernel.org \
--cc=justinstitt@google.com \
--cc=kees@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=namjain@linux.microsoft.com \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.org \
/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®