aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorDaniel Axtens <dja@axtens.net>2016-01-20 18:00:58 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-20 20:09:18 -0500
commitbf76f73c5f6554df1bd337aea5b3ea561f09632c (patch)
tree5719fb8079f122e75e3cc6b5a654907601e91b90 /arch/powerpc
parentc6d308534aef6c99904bf5862066360ae067abc4 (diff)
powerpc: enable UBSAN support
This hooks up UBSAN support for PowerPC. So far it's found some interesting cases where we don't properly sanitise input to shifts, including one in our futex handling. Nothing critical, but interesting and worth fixing. [valentinrothberg@gmail.com: arch/powerpc/Kconfig: fix typo in select statement] Signed-off-by: Daniel Axtens <dja@axtens.net> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Tested-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Acked-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/Kconfig1
-rw-r--r--arch/powerpc/kernel/Makefile8
-rw-r--r--arch/powerpc/kernel/vdso32/Makefile1
-rw-r--r--arch/powerpc/kernel/vdso64/Makefile1
-rw-r--r--arch/powerpc/xmon/Makefile1
5 files changed, 11 insertions, 1 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 94f6c5089e0c..8310be4ffe31 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -158,6 +158,7 @@ config PPC
158 select ARCH_HAS_DMA_SET_COHERENT_MASK 158 select ARCH_HAS_DMA_SET_COHERENT_MASK
159 select ARCH_HAS_DEVMEM_IS_ALLOWED 159 select ARCH_HAS_DEVMEM_IS_ALLOWED
160 select HAVE_ARCH_SECCOMP_FILTER 160 select HAVE_ARCH_SECCOMP_FILTER
161 select ARCH_HAS_UBSAN_SANITIZE_ALL
161 162
162config GENERIC_CSUM 163config GENERIC_CSUM
163 def_bool CPU_LITTLE_ENDIAN 164 def_bool CPU_LITTLE_ENDIAN
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index ba336930d448..794f22adf99d 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -136,12 +136,18 @@ endif
136obj-$(CONFIG_EPAPR_PARAVIRT) += epapr_paravirt.o epapr_hcalls.o 136obj-$(CONFIG_EPAPR_PARAVIRT) += epapr_paravirt.o epapr_hcalls.o
137obj-$(CONFIG_KVM_GUEST) += kvm.o kvm_emul.o 137obj-$(CONFIG_KVM_GUEST) += kvm.o kvm_emul.o
138 138
139# Disable GCOV in odd or sensitive code 139# Disable GCOV & sanitizers in odd or sensitive code
140GCOV_PROFILE_prom_init.o := n 140GCOV_PROFILE_prom_init.o := n
141UBSAN_SANITIZE_prom_init.o := n
141GCOV_PROFILE_ftrace.o := n 142GCOV_PROFILE_ftrace.o := n
143UBSAN_SANITIZE_ftrace.o := n
142GCOV_PROFILE_machine_kexec_64.o := n 144GCOV_PROFILE_machine_kexec_64.o := n
145UBSAN_SANITIZE_machine_kexec_64.o := n
143GCOV_PROFILE_machine_kexec_32.o := n 146GCOV_PROFILE_machine_kexec_32.o := n
147UBSAN_SANITIZE_machine_kexec_32.o := n
144GCOV_PROFILE_kprobes.o := n 148GCOV_PROFILE_kprobes.o := n
149UBSAN_SANITIZE_kprobes.o := n
150UBSAN_SANITIZE_vdso.o := n
145 151
146extra-$(CONFIG_PPC_FPU) += fpu.o 152extra-$(CONFIG_PPC_FPU) += fpu.o
147extra-$(CONFIG_ALTIVEC) += vector.o 153extra-$(CONFIG_ALTIVEC) += vector.o
diff --git a/arch/powerpc/kernel/vdso32/Makefile b/arch/powerpc/kernel/vdso32/Makefile
index 6abffb7a8cd9..cbabd143acae 100644
--- a/arch/powerpc/kernel/vdso32/Makefile
+++ b/arch/powerpc/kernel/vdso32/Makefile
@@ -15,6 +15,7 @@ targets := $(obj-vdso32) vdso32.so vdso32.so.dbg
15obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32)) 15obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
16 16
17GCOV_PROFILE := n 17GCOV_PROFILE := n
18UBSAN_SANITIZE := n
18 19
19ccflags-y := -shared -fno-common -fno-builtin 20ccflags-y := -shared -fno-common -fno-builtin
20ccflags-y += -nostdlib -Wl,-soname=linux-vdso32.so.1 \ 21ccflags-y += -nostdlib -Wl,-soname=linux-vdso32.so.1 \
diff --git a/arch/powerpc/kernel/vdso64/Makefile b/arch/powerpc/kernel/vdso64/Makefile
index 8c8f2ae43935..c710802b8fb6 100644
--- a/arch/powerpc/kernel/vdso64/Makefile
+++ b/arch/powerpc/kernel/vdso64/Makefile
@@ -8,6 +8,7 @@ targets := $(obj-vdso64) vdso64.so vdso64.so.dbg
8obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64)) 8obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))
9 9
10GCOV_PROFILE := n 10GCOV_PROFILE := n
11UBSAN_SANITIZE := n
11 12
12ccflags-y := -shared -fno-common -fno-builtin 13ccflags-y := -shared -fno-common -fno-builtin
13ccflags-y += -nostdlib -Wl,-soname=linux-vdso64.so.1 \ 14ccflags-y += -nostdlib -Wl,-soname=linux-vdso64.so.1 \
diff --git a/arch/powerpc/xmon/Makefile b/arch/powerpc/xmon/Makefile
index 1278788d96e3..436062dbb6e2 100644
--- a/arch/powerpc/xmon/Makefile
+++ b/arch/powerpc/xmon/Makefile
@@ -3,6 +3,7 @@
3subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror 3subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
4 4
5GCOV_PROFILE := n 5GCOV_PROFILE := n
6UBSAN_SANITIZE := n
6 7
7ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC) 8ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC)
8 9