aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2016-09-12 08:37:20 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2016-09-20 08:26:23 -0400
commitc42d8c7dbe596d849b43b7581bcc39b51f148c48 (patch)
tree0e8591e307b242b1be532ee4eb7149fc5fd45a7a
parent725c4d22bbc4fcac5779963e0ff9cdf232afbb90 (diff)
s390: enable UBSAN
This enables UBSAN for s390. We have to disable the null sanitizer as s390 code does access memory via a null pointer (the prefix page). Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--arch/s390/Kconfig2
-rw-r--r--arch/s390/boot/compressed/Makefile1
-rw-r--r--arch/s390/kernel/Makefile3
-rw-r--r--arch/s390/kernel/vdso32/Makefile3
-rw-r--r--arch/s390/kernel/vdso64/Makefile3
5 files changed, 10 insertions, 2 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index f4989fb4ac8d..608f4eabb2de 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -74,6 +74,7 @@ config S390
74 select ARCH_HAS_GCOV_PROFILE_ALL 74 select ARCH_HAS_GCOV_PROFILE_ALL
75 select ARCH_HAS_KCOV 75 select ARCH_HAS_KCOV
76 select ARCH_HAS_SG_CHAIN 76 select ARCH_HAS_SG_CHAIN
77 select ARCH_HAS_UBSAN_SANITIZE_ALL
77 select ARCH_HAVE_NMI_SAFE_CMPXCHG 78 select ARCH_HAVE_NMI_SAFE_CMPXCHG
78 select ARCH_INLINE_READ_LOCK 79 select ARCH_INLINE_READ_LOCK
79 select ARCH_INLINE_READ_LOCK_BH 80 select ARCH_INLINE_READ_LOCK_BH
@@ -110,6 +111,7 @@ config S390
110 select ARCH_USE_CMPXCHG_LOCKREF 111 select ARCH_USE_CMPXCHG_LOCKREF
111 select ARCH_WANTS_DYNAMIC_TASK_STRUCT 112 select ARCH_WANTS_DYNAMIC_TASK_STRUCT
112 select ARCH_WANTS_PROT_NUMA_PROT_NONE 113 select ARCH_WANTS_PROT_NUMA_PROT_NONE
114 select ARCH_WANTS_UBSAN_NO_NULL
113 select ARCH_WANT_IPC_PARSE_VERSION 115 select ARCH_WANT_IPC_PARSE_VERSION
114 select BUILDTIME_EXTABLE_SORT 116 select BUILDTIME_EXTABLE_SORT
115 select CLONE_BACKWARDS2 117 select CLONE_BACKWARDS2
diff --git a/arch/s390/boot/compressed/Makefile b/arch/s390/boot/compressed/Makefile
index 33ba697c782d..0daa070d6c9d 100644
--- a/arch/s390/boot/compressed/Makefile
+++ b/arch/s390/boot/compressed/Makefile
@@ -17,6 +17,7 @@ KBUILD_CFLAGS += $(call cc-option,-mpacked-stack)
17KBUILD_CFLAGS += $(call cc-option,-ffreestanding) 17KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
18 18
19GCOV_PROFILE := n 19GCOV_PROFILE := n
20UBSAN_SANITIZE := n
20 21
21OBJECTS := $(addprefix $(objtree)/arch/s390/kernel/, head.o sclp.o ebcdic.o als.o) 22OBJECTS := $(addprefix $(objtree)/arch/s390/kernel/, head.o sclp.o ebcdic.o als.o)
22OBJECTS += $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o 23OBJECTS += $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o
diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index 3234817c7d47..72ccc41444dc 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -48,6 +48,9 @@ AFLAGS_head.o += -march=z900
48endif 48endif
49GCOV_PROFILE_sclp.o := n 49GCOV_PROFILE_sclp.o := n
50GCOV_PROFILE_als.o := n 50GCOV_PROFILE_als.o := n
51UBSAN_SANITIZE_als.o := n
52UBSAN_SANITIZE_early.o := n
53UBSAN_SANITIZE_sclp.o := n
51 54
52obj-y := traps.o time.o process.o base.o early.o setup.o idle.o vtime.o 55obj-y := traps.o time.o process.o base.o early.o setup.o idle.o vtime.o
53obj-y += processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o nmi.o 56obj-y += processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o nmi.o
diff --git a/arch/s390/kernel/vdso32/Makefile b/arch/s390/kernel/vdso32/Makefile
index 68145456fee2..6cc947896c77 100644
--- a/arch/s390/kernel/vdso32/Makefile
+++ b/arch/s390/kernel/vdso32/Makefile
@@ -24,8 +24,9 @@ obj-y += vdso32_wrapper.o
24extra-y += vdso32.lds 24extra-y += vdso32.lds
25CPPFLAGS_vdso32.lds += -P -C -U$(ARCH) 25CPPFLAGS_vdso32.lds += -P -C -U$(ARCH)
26 26
27# Disable gcov profiling for VDSO code 27# Disable gcov profiling and ubsan for VDSO code
28GCOV_PROFILE := n 28GCOV_PROFILE := n
29UBSAN_SANITIZE := n
29 30
30# Force dependency (incbin is bad) 31# Force dependency (incbin is bad)
31$(obj)/vdso32_wrapper.o : $(obj)/vdso32.so 32$(obj)/vdso32_wrapper.o : $(obj)/vdso32.so
diff --git a/arch/s390/kernel/vdso64/Makefile b/arch/s390/kernel/vdso64/Makefile
index 0b0fd22c869a..2d54c18089eb 100644
--- a/arch/s390/kernel/vdso64/Makefile
+++ b/arch/s390/kernel/vdso64/Makefile
@@ -24,8 +24,9 @@ obj-y += vdso64_wrapper.o
24extra-y += vdso64.lds 24extra-y += vdso64.lds
25CPPFLAGS_vdso64.lds += -P -C -U$(ARCH) 25CPPFLAGS_vdso64.lds += -P -C -U$(ARCH)
26 26
27# Disable gcov profiling for VDSO code 27# Disable gcov profiling and ubsan for VDSO code
28GCOV_PROFILE := n 28GCOV_PROFILE := n
29UBSAN_SANITIZE := n
29 30
30# Force dependency (incbin is bad) 31# Force dependency (incbin is bad)
31$(obj)/vdso64_wrapper.o : $(obj)/vdso64.so 32$(obj)/vdso64_wrapper.o : $(obj)/vdso64.so