aboutsummaryrefslogtreecommitdiffstats
path: root/lib/strncpy_from_user.c
diff options
context:
space:
mode:
authorPeter Zijlstra <[email protected]>2019-04-24 07:19:24 +0000
committerIngo Molnar <[email protected]>2019-04-24 10:19:45 +0000
commit6ae865615fc43d014da2fd1f1bba7e81ee622d1b (patch)
treed13c96f1252d46f49022a1c77d5795f51baf3e87 /lib/strncpy_from_user.c
parentsched/x86_64: Don't save flags on context switch (diff)
downloadkernel-6ae865615fc43d014da2fd1f1bba7e81ee622d1b.tar.gz
kernel-6ae865615fc43d014da2fd1f1bba7e81ee622d1b.zip
x86/uaccess: Dont leak the AC flag into __put_user() argument evaluation
The __put_user() macro evaluates it's @ptr argument inside the __uaccess_begin() / __uaccess_end() region. While this would normally not be expected to be an issue, an UBSAN bug (it ignored -fwrapv, fixed in GCC 8+) would transform the @ptr evaluation for: drivers/gpu/drm/i915/i915_gem_execbuffer.c: if (unlikely(__put_user(offset, &urelocs[r-stack].presumed_offset))) { into a signed-overflow-UB check and trigger the objtool AC validation. Finish this commit: 2a418cf3f5f1 ("x86/uaccess: Don't leak the AC flag into __put_user() value evaluation") and explicitly evaluate all 3 arguments early. Reported-by: Randy Dunlap <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Randy Dunlap <[email protected]> # build-tested Acked-by: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Fixes: 2a418cf3f5f1 ("x86/uaccess: Don't leak the AC flag into __put_user() value evaluation") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'lib/strncpy_from_user.c')
0 files changed, 0 insertions, 0 deletions