Skip to content

Commit 6040e57

Browse files
committed
Make the hardened user-copy code depend on having a hardened allocator
The kernel test robot reported a usercopy failure in the new hardened sanity checks, due to a page-crossing copy of the FPU state into the task structure. This happened because the kernel test robot was testing with SLOB, which doesn't actually do the required book-keeping for slab allocations, and as a result the hardening code didn't realize that the task struct allocation was one single allocation - and the sanity checks fail. Since SLOB doesn't even claim to support hardening (and you really shouldn't use it), the straightforward solution is to just make the usercopy hardening code depend on the allocator supporting it. Reported-by: kernel test robot <xiaolong.ye@intel.com> Cc: Kees Cook <keescook@chromium.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 8cc9ddd commit 6040e57

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

security/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ config HAVE_ARCH_HARDENED_USERCOPY
136136
config HARDENED_USERCOPY
137137
bool "Harden memory copies between kernel and userspace"
138138
depends on HAVE_ARCH_HARDENED_USERCOPY
139+
depends on HAVE_HARDENED_USERCOPY_ALLOCATOR
139140
select BUG
140141
help
141142
This option checks for obviously wrong memory regions when

0 commit comments

Comments
 (0)