aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/str_error.c
diff options
context:
space:
mode:
authorAndy Lutomirski <[email protected]>2018-08-29 15:47:18 +0000
committerThomas Gleixner <[email protected]>2018-08-31 15:08:22 +0000
commit4012e77a903d114f915fc607d6d2ed54a3d6c9b1 (patch)
treeaa56d63db999604dd3004855996dca36c293e1cf /tools/lib/bpf/str_error.c
parentx86: Allow generating user-space headers without a compiler (diff)
downloadkernel-4012e77a903d114f915fc607d6d2ed54a3d6c9b1.tar.gz
kernel-4012e77a903d114f915fc607d6d2ed54a3d6c9b1.zip
x86/nmi: Fix NMI uaccess race against CR3 switching
A NMI can hit in the middle of context switching or in the middle of switch_mm_irqs_off(). In either case, CR3 might not match current->mm, which could cause copy_from_user_nmi() and friends to read the wrong memory. Fix it by adding a new nmi_uaccess_okay() helper and checking it in copy_from_user_nmi() and in __copy_from_user_nmi()'s callers. Signed-off-by: Andy Lutomirski <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Rik van Riel <[email protected]> Cc: Nadav Amit <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Jann Horn <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/dd956eba16646fd0b15c3c0741269dfd84452dac.1535557289.git.luto@kernel.org
Diffstat (limited to 'tools/lib/bpf/str_error.c')
0 files changed, 0 insertions, 0 deletions