[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240223182646.GA2825372@ravnborg.org>
Date: Fri, 23 Feb 2024 19:26:46 +0100
From: Sam Ravnborg <sam@...nborg.org>
To: Kees Cook <keescook@...omium.org>
Cc: "David S. Miller" <davem@...emloft.net>,
Andreas Larsson <andreas@...sler.com>,
Masahiro Yamada <masahiroy@...nel.org>,
Helge Deller <deller@....de>, Guo Ren <guoren@...nel.org>,
sparclinux@...r.kernel.org,
Catalin Marinas <catalin.marinas@....com>,
"Russell King (Oracle)" <rmk+kernel@...linux.org.uk>,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH] sparc: vdso: Disable UBSAN instrumentation
Hi Kees,
On Fri, Feb 23, 2024 at 08:59:45AM -0800, Kees Cook wrote:
> The UBSAN instrumentation cannot work in the vDSO since it is executing
> in userspace, so disable it in the Makefile. Fixes the build failures
> such as:
>
> arch/sparc/vdso/vclock_gettime.c:217: undefined reference to `__ubsan_handle_shift_out_of_bounds'
>
> Signed-off-by: Kees Cook <keescook@...omium.org>
> ---
> Cc: "David S. Miller" <davem@...emloft.net>
> Cc: Andreas Larsson <andreas@...sler.com>
> Cc: Masahiro Yamada <masahiroy@...nel.org>
> Cc: Sam Ravnborg <sam@...nborg.org>
> Cc: Helge Deller <deller@....de>
> Cc: Guo Ren <guoren@...nel.org>
> Cc: sparclinux@...r.kernel.org
> ---
> arch/sparc/vdso/Makefile | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/sparc/vdso/Makefile b/arch/sparc/vdso/Makefile
> index 7f5eedf1f5e0..e8aef2c8ae99 100644
> --- a/arch/sparc/vdso/Makefile
> +++ b/arch/sparc/vdso/Makefile
> @@ -2,6 +2,7 @@
> #
> # Building vDSO images for sparc.
> #
> +UBSAN_SANITIZE := n
When I read:
config UBSAN_SANITIZE_ALL
bool "Enable instrumentation for the entire kernel"
depends on ARCH_HAS_UBSAN_SANITIZE_ALL
default y
help
This option activates instrumentation for the entire kernel.
If you don't enable this option, you have to explicitly specify
UBSAN_SANITIZE := y for the files/directories you want to check for UB.
Enabling this option will get kernel image size increased
significantly.
I am left with the understanding that only arch's that
selects ARCH_HAS_UBSAN_SANITIZE_ALL would need to turn off
UBSAN_SANITIZE.
Are this fix papering over some other bug where we enable
UBSAN_SANITIZE_ALL for arch's that should not have it,
or something else that enable it?
Sam
Powered by blists - more mailing lists