diff options
author | Kees Cook <keescook@chromium.org> | 2017-08-16 17:09:13 -0400 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2018-01-15 15:08:06 -0500 |
commit | 08626a6056aad824c43d34ce587ab2b01f49d1a4 (patch) | |
tree | cbf024b04979925f657fb5fead7d10edac2efbe7 | |
parent | 9e8084d3f761413b2d58b2625bc6e332eab2bfce (diff) |
arm: Implement thread_struct whitelist for hardened usercopy
While ARM32 carries FPU state in the thread structure that is saved and
restored during signal handling, it doesn't need to declare a usercopy
whitelist, since existing accessors are all either using a bounce buffer
(for which whitelisting isn't checking the slab), are statically sized
(which will bypass the hardened usercopy check), or both.
Cc: Russell King <linux@armlinux.org.uk>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Kees Cook <keescook@chromium.org>
-rw-r--r-- | arch/arm/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/include/asm/processor.h | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 51c8df561077..3ea00d65f35d 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -50,6 +50,7 @@ config ARM | |||
50 | select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU | 50 | select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU |
51 | select HAVE_ARCH_MMAP_RND_BITS if MMU | 51 | select HAVE_ARCH_MMAP_RND_BITS if MMU |
52 | select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT) | 52 | select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT) |
53 | select HAVE_ARCH_THREAD_STRUCT_WHITELIST | ||
53 | select HAVE_ARCH_TRACEHOOK | 54 | select HAVE_ARCH_TRACEHOOK |
54 | select HAVE_ARM_SMCCC if CPU_V7 | 55 | select HAVE_ARM_SMCCC if CPU_V7 |
55 | select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32 | 56 | select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32 |
diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h index 338cbe0a18ef..1bf65b47808a 100644 --- a/arch/arm/include/asm/processor.h +++ b/arch/arm/include/asm/processor.h | |||
@@ -45,6 +45,16 @@ struct thread_struct { | |||
45 | struct debug_info debug; | 45 | struct debug_info debug; |
46 | }; | 46 | }; |
47 | 47 | ||
48 | /* | ||
49 | * Everything usercopied to/from thread_struct is statically-sized, so | ||
50 | * no hardened usercopy whitelist is needed. | ||
51 | */ | ||
52 | static inline void arch_thread_struct_whitelist(unsigned long *offset, | ||
53 | unsigned long *size) | ||
54 | { | ||
55 | *offset = *size = 0; | ||
56 | } | ||
57 | |||
48 | #define INIT_THREAD { } | 58 | #define INIT_THREAD { } |
49 | 59 | ||
50 | #define start_thread(regs,pc,sp) \ | 60 | #define start_thread(regs,pc,sp) \ |