From: Kees Cook <kees@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Kees Cook <kees@debian.org>,
mingo@kernel.org, oleg@redhat.com, linux-kernel@vger.kernel.org,
debian-kernel@lists.debian.org
Subject: Re: [PATCH] seqlock: Allow UBSAN to fail optimizing
Date: Sun, 1 Feb 2026 19:39:46 -0800 [thread overview]
Message-ID: <202602011935.9E968135@keescook> (raw)
In-Reply-To: <20260201114741.GA3016024@noisy.programming.kicks-ass.net>
On Sun, Feb 01, 2026 at 12:47:41PM +0100, Peter Zijlstra wrote:
> On Sat, Jan 31, 2026 at 10:42:35AM -0800, Kees Cook wrote:
> > On Sat, Jan 31, 2026 at 10:39:42AM +0100, Salvatore Bonaccorso wrote:
> > > Kees, Peter approached the Debian kernel list above to drop
> > > CONFIG_UBSAN again, which, so I think we need to revert your
> > > 6cfadabfe015 ("Enable UBSAN_BOUNDS and UBSAN_SHIFT"):
> > > https://salsa.debian.org/kernel-team/linux/-/commit/6cfadabfe015fa0d659fc8e3efd495cbcae3e44e
> > >
> > > I have make a MR for our packaging for the change in
> > > https://salsa.debian.org/kernel-team/linux/-/merge_requests/1804
> >
> > I am strongly opposed -- this undoes years of security flaw mitigation
> > work and leaves Debian (and only Debian!) exposed to trivial array index
> > overflows. The bounds sanitizer is the corner stone of memory safety
> > for C, and is not some "experimental" feature. GCC has a long history
> > of trouble with inlining, so this is not something unique to enabling
> > this feature.
> >
> > I replied similarly to the PR. This would be a major mistake to disable.
>
> Why the heck is bounds checking part of UBSAN? The simple fix here is to
> get it out from CONFIG_UBSAN, so that CONFIG_UBSAN is debug only crap.
Out of bounds accesses are considered "undefined". *sigh*
But yes, now that we have the "transitional" kconfig symbols I can
trivially rename CONFIG_UBSAN_BOUNDS and remove its CONFIG_UBSAN
dependency.
> Notably, none of the UBSAN configs that tripped the optimization fail
> even had bounds checking enabled.
Which ones tripped it? KASAN (in software tagging mode) is usually the
heavy-weight one that considerably bloats code generation. I haven't
seen systemic problems with -fsanitize=bounds, and I thought the weird
cases (which confused the value range tracking) with -fsanitize=shift
got fixed back in GCC 12 (or maybe 13).
-Kees
--
Kees Cook
next prev parent reply other threads:[~2026-02-02 3:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-29 11:07 [PATCH] seqlock: Allow UBSAN to fail optimizing Peter Zijlstra
2026-01-31 9:39 ` Salvatore Bonaccorso
2026-01-31 18:42 ` Kees Cook
2026-02-01 11:47 ` Peter Zijlstra
2026-02-02 3:39 ` Kees Cook [this message]
2026-02-02 8:29 ` Peter Zijlstra
2026-02-02 16:01 ` Kees Cook
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=202602011935.9E968135@keescook \
--to=kees@kernel.org \
--cc=debian-kernel@lists.debian.org \
--cc=kees@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=oleg@redhat.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