linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: Enable Undefined Behavior Sanitizer UBSAN
@ 2018-11-20  0:49 Hassan Naveed
  2018-11-20  0:49 ` Hassan Naveed
  2018-11-20 22:00 ` Paul Burton
  0 siblings, 2 replies; 4+ messages in thread
From: Hassan Naveed @ 2018-11-20  0:49 UTC (permalink / raw)
  To: linux-mips; +Cc: Hassan Naveed

From: Hassan Naveed <hnaveed@wavecomp.com>

Select ARCH_HAS_UBSAN_SANITIZE_ALL in order to allow the user to
enable CONFIG_UBSAN_SANITIZE_ALL and instrument the entire kernel for
ubsan checks.
We exclude the VDSO from this because its build doesn't include the
__ubsan_handle_*() functions that the kernel proper defines in from
lib/ubsan.c, and the VDSO would have no sane way to report errors even
if it had definitions of these functions.

Signed-off-by: Hassan Naveed <hnaveed@wavecomp.com>
Reviewed-by: Paul Burton <paul.burton@mips.com>
---
 arch/mips/Kconfig       | 1 +
 arch/mips/vdso/Makefile | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 35511999156a..8418721bb3f9 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -7,6 +7,7 @@ config MIPS
 	select ARCH_DISCARD_MEMBLOCK
 	select ARCH_HAS_ELF_RANDOMIZE
 	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
+	select ARCH_HAS_UBSAN_SANITIZE_ALL
 	select ARCH_SUPPORTS_UPROBES
 	select ARCH_USE_BUILTIN_BSWAP
 	select ARCH_USE_CMPXCHG_LOCKREF if 64BIT
diff --git a/arch/mips/vdso/Makefile b/arch/mips/vdso/Makefile
index 34605ca21498..b0f2382b5671 100644
--- a/arch/mips/vdso/Makefile
+++ b/arch/mips/vdso/Makefile
@@ -50,6 +50,7 @@ VDSO_LDFLAGS := \
 	$(call cc-ldoption, -Wl$(comma)--build-id)
 
 GCOV_PROFILE := n
+UBSAN_SANITIZE := n
 
 #
 # Shared build commands.
-- 
2.19.0

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

* [PATCH] MIPS: Enable Undefined Behavior Sanitizer UBSAN
  2018-11-20  0:49 [PATCH] MIPS: Enable Undefined Behavior Sanitizer UBSAN Hassan Naveed
@ 2018-11-20  0:49 ` Hassan Naveed
  2018-11-20 22:00 ` Paul Burton
  1 sibling, 0 replies; 4+ messages in thread
From: Hassan Naveed @ 2018-11-20  0:49 UTC (permalink / raw)
  To: linux-mips; +Cc: Hassan Naveed

From: Hassan Naveed <hnaveed@wavecomp.com>

Select ARCH_HAS_UBSAN_SANITIZE_ALL in order to allow the user to
enable CONFIG_UBSAN_SANITIZE_ALL and instrument the entire kernel for
ubsan checks.
We exclude the VDSO from this because its build doesn't include the
__ubsan_handle_*() functions that the kernel proper defines in from
lib/ubsan.c, and the VDSO would have no sane way to report errors even
if it had definitions of these functions.

Signed-off-by: Hassan Naveed <hnaveed@wavecomp.com>
Reviewed-by: Paul Burton <paul.burton@mips.com>
---
 arch/mips/Kconfig       | 1 +
 arch/mips/vdso/Makefile | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 35511999156a..8418721bb3f9 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -7,6 +7,7 @@ config MIPS
 	select ARCH_DISCARD_MEMBLOCK
 	select ARCH_HAS_ELF_RANDOMIZE
 	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
+	select ARCH_HAS_UBSAN_SANITIZE_ALL
 	select ARCH_SUPPORTS_UPROBES
 	select ARCH_USE_BUILTIN_BSWAP
 	select ARCH_USE_CMPXCHG_LOCKREF if 64BIT
diff --git a/arch/mips/vdso/Makefile b/arch/mips/vdso/Makefile
index 34605ca21498..b0f2382b5671 100644
--- a/arch/mips/vdso/Makefile
+++ b/arch/mips/vdso/Makefile
@@ -50,6 +50,7 @@ VDSO_LDFLAGS := \
 	$(call cc-ldoption, -Wl$(comma)--build-id)
 
 GCOV_PROFILE := n
+UBSAN_SANITIZE := n
 
 #
 # Shared build commands.
-- 
2.19.0

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

* Re: [PATCH] MIPS: Enable Undefined Behavior Sanitizer UBSAN
  2018-11-20  0:49 [PATCH] MIPS: Enable Undefined Behavior Sanitizer UBSAN Hassan Naveed
  2018-11-20  0:49 ` Hassan Naveed
@ 2018-11-20 22:00 ` Paul Burton
  2018-11-20 22:00   ` Paul Burton
  1 sibling, 1 reply; 4+ messages in thread
From: Paul Burton @ 2018-11-20 22:00 UTC (permalink / raw)
  To: Hassan Naveed, Hassan Naveed; +Cc: linux-mips, Hassan Naveed, linux-mips

Hello,

Hassan Naveed Hassan Naveed wrote:
> From: Hassan Naveed <hnaveed@wavecomp.com>
> 
> Select ARCH_HAS_UBSAN_SANITIZE_ALL in order to allow the user to
> enable CONFIG_UBSAN_SANITIZE_ALL and instrument the entire kernel for
> ubsan checks.
> We exclude the VDSO from this because its build doesn't include the
> __ubsan_handle_*() functions that the kernel proper defines in from
> lib/ubsan.c, and the VDSO would have no sane way to report errors even
> if it had definitions of these functions.
> 
> Signed-off-by: Hassan Naveed <hnaveed@wavecomp.com>
> Reviewed-by: Paul Burton <paul.burton@mips.com>

Applied to mips-next.

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paul.burton@mips.com to report it. ]

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

* Re: [PATCH] MIPS: Enable Undefined Behavior Sanitizer UBSAN
  2018-11-20 22:00 ` Paul Burton
@ 2018-11-20 22:00   ` Paul Burton
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Burton @ 2018-11-20 22:00 UTC (permalink / raw)
  To: Hassan Naveed; +Cc: linux-mips

Hello,

Hassan Naveed Hassan Naveed wrote:
> From: Hassan Naveed <hnaveed@wavecomp.com>
> 
> Select ARCH_HAS_UBSAN_SANITIZE_ALL in order to allow the user to
> enable CONFIG_UBSAN_SANITIZE_ALL and instrument the entire kernel for
> ubsan checks.
> We exclude the VDSO from this because its build doesn't include the
> __ubsan_handle_*() functions that the kernel proper defines in from
> lib/ubsan.c, and the VDSO would have no sane way to report errors even
> if it had definitions of these functions.
> 
> Signed-off-by: Hassan Naveed <hnaveed@wavecomp.com>
> Reviewed-by: Paul Burton <paul.burton@mips.com>

Applied to mips-next.

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paul.burton@mips.com to report it. ]

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

end of thread, other threads:[~2018-11-20 22:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-20  0:49 [PATCH] MIPS: Enable Undefined Behavior Sanitizer UBSAN Hassan Naveed
2018-11-20  0:49 ` Hassan Naveed
2018-11-20 22:00 ` Paul Burton
2018-11-20 22:00   ` Paul Burton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).