diff options
author | Kees Cook <keescook@chromium.org> | 2017-02-13 11:25:26 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-06-14 15:06:05 +0200 |
commit | a6a7d8ade88ce634f7ff14143714a1301d171001 (patch) | |
tree | 68950718eb2648acb6615d7c8012e5eb14637378 /lib/once.c | |
parent | eefa5e13dff94000af79a6ec173376f6eb629bc1 (diff) |
usercopy: Adjust tests to deal with SMAP/PAN
commit f5f893c57e37ca730808cb2eee3820abd05e7507 upstream.
Under SMAP/PAN/etc, we cannot write directly to userspace memory, so
this rearranges the test bytes to get written through copy_to_user().
Additionally drops the bad copy_from_user() test that would trigger a
memcpy() against userspace on failure.
[arnd: the test module was added in 3.14, and this backported patch
should apply cleanly on all version from 3.14 to 4.10.
The original patch was in 4.11 on top of a context change
I saw the bug triggered with kselftest on a 4.4.y stable kernel]
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/once.c')
0 files changed, 0 insertions, 0 deletions