]> git.baikalelectronics.ru Git - kernel.git/commit
usercopy: Allow strict enforcement of whitelists
authorKees Cook <keescook@chromium.org>
Thu, 30 Nov 2017 21:04:32 +0000 (13:04 -0800)
committerKees Cook <keescook@chromium.org>
Mon, 15 Jan 2018 20:07:48 +0000 (12:07 -0800)
commita080d8e5a374641f4f404d314c570b52cfbd6fd2
tree1dac3dd3aac5a0fed8046b6f85bd944211260c70
parentdfd79a4c624fb2c6e80e0347e83132c76a730c02
usercopy: Allow strict enforcement of whitelists

This introduces CONFIG_HARDENED_USERCOPY_FALLBACK to control the
behavior of hardened usercopy whitelist violations. By default, whitelist
violations will continue to WARN() so that any bad or missing usercopy
whitelists can be discovered without being too disruptive.

If this config is disabled at build time or a system is booted with
"slab_common.usercopy_fallback=0", usercopy whitelists will BUG() instead
of WARN(). This is useful for admins that want to use usercopy whitelists
immediately.

Suggested-by: Matthew Garrett <mjg59@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
include/linux/slab.h
mm/slab.c
mm/slab_common.c
mm/slub.c
security/Kconfig