linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched.h: drop in_ubsan field when UBSAN is in trap mode
@ 2020-09-10 13:48 Elena Petrova
  2020-09-10 19:16 ` Kees Cook
  2020-09-10 19:35 ` Jann Horn
  0 siblings, 2 replies; 5+ messages in thread
From: Elena Petrova @ 2020-09-10 13:48 UTC (permalink / raw)
  To: kernel-hardening; +Cc: Elena Petrova, linux-kernel, Kees Cook

in_ubsan field of task_struct is only used in lib/ubsan.c, which in its
turn is used only `ifneq ($(CONFIG_UBSAN_TRAP),y)`.

Removing unnecessary field from a task_struct will help preserve the
ABI between vanilla and CONFIG_UBSAN_TRAP'ed kernels. In particular,
this will help enabling bounds sanitizer transparently for Android's
GKI.

Signed-off-by: Elena Petrova <lenaptr@google.com>
---
 include/linux/sched.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index afe01e232935..5c7b8dec236e 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1008,7 +1008,7 @@ struct task_struct {
 	struct held_lock		held_locks[MAX_LOCK_DEPTH];
 #endif
 
-#ifdef CONFIG_UBSAN
+#if defined(CONFIG_UBSAN) && !defined(CONFIG_UBSAN_TRAP)
 	unsigned int			in_ubsan;
 #endif
 
-- 
2.28.0.526.ge36021eeef-goog


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

end of thread, other threads:[~2020-09-11 16:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 13:48 [PATCH] sched.h: drop in_ubsan field when UBSAN is in trap mode Elena Petrova
2020-09-10 19:16 ` Kees Cook
2020-09-10 19:35 ` Jann Horn
2020-09-11 15:15   ` Elena Petrova
2020-09-11 16:22     ` Jann Horn

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).