Skip to content

Commit 9e8084d

Browse files
committed
arm64: Implement thread_struct whitelist for hardened usercopy
While ARM64 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: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: James Morse <[email protected]> Cc: "Peter Zijlstra (Intel)" <[email protected]> Cc: Dave Martin <[email protected]> Cc: zijun_hu <[email protected]> Cc: [email protected] Signed-off-by: Kees Cook <[email protected]>
1 parent f7d83c1 commit 9e8084d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

arch/arm64/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ config ARM64
9090
select HAVE_ARCH_MMAP_RND_BITS
9191
select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT
9292
select HAVE_ARCH_SECCOMP_FILTER
93+
select HAVE_ARCH_THREAD_STRUCT_WHITELIST
9394
select HAVE_ARCH_TRACEHOOK
9495
select HAVE_ARCH_TRANSPARENT_HUGEPAGE
9596
select HAVE_ARCH_VMAP_STACK

arch/arm64/include/asm/processor.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,16 @@ struct thread_struct {
113113
struct debug_info debug; /* debugging */
114114
};
115115

116+
/*
117+
* Everything usercopied to/from thread_struct is statically-sized, so
118+
* no hardened usercopy whitelist is needed.
119+
*/
120+
static inline void arch_thread_struct_whitelist(unsigned long *offset,
121+
unsigned long *size)
122+
{
123+
*offset = *size = 0;
124+
}
125+
116126
#ifdef CONFIG_COMPAT
117127
#define task_user_tls(t) \
118128
({ \

0 commit comments

Comments
 (0)