]> git.karo-electronics.de Git - karo-tx-linux.git/commit
test: check copy_to/from_user boundary validation
authorKees Cook <keescook@chromium.org>
Fri, 3 Jan 2014 03:10:15 +0000 (14:10 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 3 Jan 2014 03:10:15 +0000 (14:10 +1100)
commita4f0d1b9cddc52dcc8535889b987d6f52adc2e34
treeb4ce2fb51f8e104b83390569d15589f8bc7baca6
parentc5f3311cde4e8a9c3caecd0af1a6a36c67dc8dc6
test: check copy_to/from_user boundary validation

To help avoid an architecture failing to correctly check kernel/user
boundaries when handling copy_to_user, copy_from_user, put_user, or
get_user, perform some simple tests and fail to load if any of them behave
unexpectedly.

Specifically, this is to make sure there is a way to notice if things like
what was fixed in 8404663f81 ("ARM: 7527/1: uaccess: explicitly check
__user pointer when !CPU_USE_DOMAINS") ever regresses again, for any
architecture.

Additionally, adds new "user" selftest target, which loads this module.

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/Kconfig.debug
lib/Makefile
lib/test_user_copy.c [new file with mode: 0644]
tools/testing/selftests/Makefile
tools/testing/selftests/user/Makefile [new file with mode: 0644]