Skip to content

Commit 08626a6

Browse files
committed
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 <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: "Peter Zijlstra (Intel)" <[email protected]> Cc: [email protected] Signed-off-by: Kees Cook <[email protected]>
1 parent 9e8084d commit 08626a6

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

arch/arm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ config ARM
5050
select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
5151
select HAVE_ARCH_MMAP_RND_BITS if MMU
5252
select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT)
53+
select HAVE_ARCH_THREAD_STRUCT_WHITELIST
5354
select HAVE_ARCH_TRACEHOOK
5455
select HAVE_ARM_SMCCC if CPU_V7
5556
select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32

arch/arm/include/asm/processor.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ struct thread_struct {
4545
struct debug_info debug;
4646
};
4747

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+
4858
#define INIT_THREAD { }
4959

5060
#define start_thread(regs,pc,sp) \

0 commit comments

Comments
 (0)