All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] LoongArch: vDSO: Disable UBSAN instrumentation
@ 2024-01-30 23:31 Kees Cook
  2024-01-31  6:05 ` Huacai Chen
  0 siblings, 1 reply; 2+ messages in thread
From: Kees Cook @ 2024-01-30 23:31 UTC (permalink / raw)
  To: Huacai Chen
  Cc: Kees Cook, kernel test robot, WANG Xuerui, Vincenzo Frascino,
	Nathan Chancellor, Masahiro Yamada, Fangrui Song, loongarch,
	Thomas Gleixner, Qing Zhang, Feiyang Chen, linux-kernel,
	linux-hardening

The vDSO executes in userspace, so the kernel's UBSAN should not
instrument it. Solves these kind of build errors:

  loongarch64-linux-ld: arch/loongarch/vdso/vgettimeofday.o: in function `vdso_shift_ns':
  lib/vdso/gettimeofday.c:23:(.text+0x3f8): undefined reference to `__ubsan_handle_shift_out_of_bounds'

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202401310530.lZHCj1Zl-lkp@intel.com/
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: WANG Xuerui <kernel@xen0n.name>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Fangrui Song <maskray@google.com>
Cc: loongarch@lists.linux.dev
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 arch/loongarch/vdso/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/loongarch/vdso/Makefile b/arch/loongarch/vdso/Makefile
index c74c9921304f..f597cd08a96b 100644
--- a/arch/loongarch/vdso/Makefile
+++ b/arch/loongarch/vdso/Makefile
@@ -2,6 +2,7 @@
 # Objects to go into the VDSO.
 
 KASAN_SANITIZE := n
+UBSAN_SANITIZE := n
 KCOV_INSTRUMENT := n
 
 # Include the generic Makefile to check the built vdso.
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] LoongArch: vDSO: Disable UBSAN instrumentation
  2024-01-30 23:31 [PATCH] LoongArch: vDSO: Disable UBSAN instrumentation Kees Cook
@ 2024-01-31  6:05 ` Huacai Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Huacai Chen @ 2024-01-31  6:05 UTC (permalink / raw)
  To: Kees Cook
  Cc: kernel test robot, WANG Xuerui, Vincenzo Frascino,
	Nathan Chancellor, Masahiro Yamada, Fangrui Song, loongarch,
	Thomas Gleixner, Qing Zhang, Feiyang Chen, linux-kernel,
	linux-hardening

Queued, thanks.

Huacai

On Wed, Jan 31, 2024 at 7:31 AM Kees Cook <keescook@chromium.org> wrote:
>
> The vDSO executes in userspace, so the kernel's UBSAN should not
> instrument it. Solves these kind of build errors:
>
>   loongarch64-linux-ld: arch/loongarch/vdso/vgettimeofday.o: in function `vdso_shift_ns':
>   lib/vdso/gettimeofday.c:23:(.text+0x3f8): undefined reference to `__ubsan_handle_shift_out_of_bounds'
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202401310530.lZHCj1Zl-lkp@intel.com/
> Cc: Huacai Chen <chenhuacai@kernel.org>
> Cc: WANG Xuerui <kernel@xen0n.name>
> Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
> Cc: Nathan Chancellor <nathan@kernel.org>
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Cc: Fangrui Song <maskray@google.com>
> Cc: loongarch@lists.linux.dev
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
>  arch/loongarch/vdso/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/loongarch/vdso/Makefile b/arch/loongarch/vdso/Makefile
> index c74c9921304f..f597cd08a96b 100644
> --- a/arch/loongarch/vdso/Makefile
> +++ b/arch/loongarch/vdso/Makefile
> @@ -2,6 +2,7 @@
>  # Objects to go into the VDSO.
>
>  KASAN_SANITIZE := n
> +UBSAN_SANITIZE := n
>  KCOV_INSTRUMENT := n
>
>  # Include the generic Makefile to check the built vdso.
> --
> 2.34.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-31  6:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-30 23:31 [PATCH] LoongArch: vDSO: Disable UBSAN instrumentation Kees Cook
2024-01-31  6:05 ` Huacai Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.