diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2016-09-12 08:37:20 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2016-09-20 08:26:23 -0400 |
commit | c42d8c7dbe596d849b43b7581bcc39b51f148c48 (patch) | |
tree | 0e8591e307b242b1be532ee4eb7149fc5fd45a7a | |
parent | 725c4d22bbc4fcac5779963e0ff9cdf232afbb90 (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/Kconfig | 2 | ||||
-rw-r--r-- | arch/s390/boot/compressed/Makefile | 1 | ||||
-rw-r--r-- | arch/s390/kernel/Makefile | 3 | ||||
-rw-r--r-- | arch/s390/kernel/vdso32/Makefile | 3 | ||||
-rw-r--r-- | arch/s390/kernel/vdso64/Makefile | 3 |
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) | |||
17 | KBUILD_CFLAGS += $(call cc-option,-ffreestanding) | 17 | KBUILD_CFLAGS += $(call cc-option,-ffreestanding) |
18 | 18 | ||
19 | GCOV_PROFILE := n | 19 | GCOV_PROFILE := n |
20 | UBSAN_SANITIZE := n | ||
20 | 21 | ||
21 | OBJECTS := $(addprefix $(objtree)/arch/s390/kernel/, head.o sclp.o ebcdic.o als.o) | 22 | OBJECTS := $(addprefix $(objtree)/arch/s390/kernel/, head.o sclp.o ebcdic.o als.o) |
22 | OBJECTS += $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o | 23 | OBJECTS += $(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 | |||
48 | endif | 48 | endif |
49 | GCOV_PROFILE_sclp.o := n | 49 | GCOV_PROFILE_sclp.o := n |
50 | GCOV_PROFILE_als.o := n | 50 | GCOV_PROFILE_als.o := n |
51 | UBSAN_SANITIZE_als.o := n | ||
52 | UBSAN_SANITIZE_early.o := n | ||
53 | UBSAN_SANITIZE_sclp.o := n | ||
51 | 54 | ||
52 | obj-y := traps.o time.o process.o base.o early.o setup.o idle.o vtime.o | 55 | obj-y := traps.o time.o process.o base.o early.o setup.o idle.o vtime.o |
53 | obj-y += processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o nmi.o | 56 | obj-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 | |||
24 | extra-y += vdso32.lds | 24 | extra-y += vdso32.lds |
25 | CPPFLAGS_vdso32.lds += -P -C -U$(ARCH) | 25 | CPPFLAGS_vdso32.lds += -P -C -U$(ARCH) |
26 | 26 | ||
27 | # Disable gcov profiling for VDSO code | 27 | # Disable gcov profiling and ubsan for VDSO code |
28 | GCOV_PROFILE := n | 28 | GCOV_PROFILE := n |
29 | UBSAN_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 | |||
24 | extra-y += vdso64.lds | 24 | extra-y += vdso64.lds |
25 | CPPFLAGS_vdso64.lds += -P -C -U$(ARCH) | 25 | CPPFLAGS_vdso64.lds += -P -C -U$(ARCH) |
26 | 26 | ||
27 | # Disable gcov profiling for VDSO code | 27 | # Disable gcov profiling and ubsan for VDSO code |
28 | GCOV_PROFILE := n | 28 | GCOV_PROFILE := n |
29 | UBSAN_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 |