[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 3 Mar 2023 12:29:23 -0800
From: Kees Cook <keescook@...omium.org>
To: Nathan Chancellor <nathan@...nel.org>
Cc: Marco Elver <elver@...gle.com>,
Masahiro Yamada <masahiroy@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Nicolas Schier <nicolas@...sle.eu>, Tom Rix <trix@...hat.com>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Miroslav Benes <mbenes@...e.cz>, linux-kbuild@...r.kernel.org,
llvm@...ts.linux.dev,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH] ubsan: Tighten UBSAN_BOUNDS on GCC
On Fri, Mar 03, 2023 at 08:44:33AM -0700, Nathan Chancellor wrote:
> On Thu, Mar 02, 2023 at 02:54:45PM -0800, Kees Cook wrote:
> > [...]
> > config CC_HAS_UBSAN_ARRAY_BOUNDS
> > def_bool $(cc-option,-fsanitize=array-bounds)
> > + help
> > + The -fsanitize=array-bounds option is only available on Clang,
> > + and is actually composed of two more specific options,
> > + -fsanitize=array-bounds and -fsanitize=local-bounds. However,
> > + -fsanitize=local-bounds can only be used when trap mode is
> > + enabled. (See also the help for CONFIG_LOCAL_BOUNDS.)
>
> The first sentence does not read right to me, you have array-bounds
> twice. I think the first one wants to be just bounds?
Oops, yes. I rewrote that a few times and seem to have gotten lost. I
think it is better written as:
Under Clang, the -fsanitize=bounds option is actually composed
of two more specific options, -fsanitize=array-bounds and
-fsanitize=local-bounds. However, -fsanitize=local-bounds can
only be used when trap mode is enabled. (See also the help for
CONFIG_LOCAL_BOUNDS.) Explicitly check for -fsanitize=array-bounds
so that we can build up the options needed for UBSAN_BOUNDS
with or without UBSAN_TRAP.
--
Kees Cook
Powered by blists - more mailing lists