]> git.baikalelectronics.ru Git - kernel.git/commit
Make the hardened user-copy code depend on having a hardened allocator
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 19 Aug 2016 19:47:01 +0000 (12:47 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 19 Aug 2016 19:47:01 +0000 (12:47 -0700)
commit5538148b7937a1b6707ce4e40254f41dbd5f533e
treeddf7a0567b1b57c579c51f13d29e790bd046152b
parentdd33dca6c557a215311e55991ffba037c6d63d0d
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>
security/Kconfig