summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-08-19 12:47:01 -0700
committerAmit Pundir <amit.pundir@linaro.org>2016-09-14 14:43:39 +0530
commit03eb77747db507cf82f7bf2e60c9b613e88ed85d (patch)
tree7b5263397d817d562a9059c5efa9cb023a5f46cd /security
parent8e4b2f84a8926e0b49cfbcd14dd8e58b5af84791 (diff)
UPSTREAM: 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> Change-Id: I37d51f866f873341bf7d5297249899b852e1c6ce (cherry picked from commit 6040e57658eee6eb1315a26119101ca832d1f854) Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Diffstat (limited to 'security')
-rw-r--r--security/Kconfig1
1 files changed, 1 insertions, 0 deletions
diff --git a/security/Kconfig b/security/Kconfig
index aba6a8d4d1f4..2b42c225de28 100644
--- a/security/Kconfig
+++ b/security/Kconfig
@@ -145,6 +145,7 @@ config HAVE_ARCH_HARDENED_USERCOPY
config HARDENED_USERCOPY
bool "Harden memory copies between kernel and userspace"
depends on HAVE_ARCH_HARDENED_USERCOPY
+ depends on HAVE_HARDENED_USERCOPY_ALLOCATOR
select BUG
help
This option checks for obviously wrong memory regions when