]> Git Repo - linux.git/commit
bpf: fix possible spectre-v1 in find_and_alloc_map()
authorMark Rutland <[email protected]>
Thu, 3 May 2018 16:04:59 +0000 (17:04 +0100)
committerDaniel Borkmann <[email protected]>
Thu, 3 May 2018 23:16:11 +0000 (01:16 +0200)
commit9ef09e35e521bf0df5325cc9cffa726a8f5f3c1b
treeeb370cdca5ac43b3ed7e9ce1e0e8ab14a54a673b
parenta8d7aa17bbc970971ccdf71988ea19230ab368b1
bpf: fix possible spectre-v1 in find_and_alloc_map()

It's possible for userspace to control attr->map_type. Sanitize it when
using it as an array index to prevent an out-of-bounds value being used
under speculation.

Found by smatch.

Signed-off-by: Mark Rutland <[email protected]>
Cc: Alexei Starovoitov <[email protected]>
Cc: Dan Carpenter <[email protected]>
Cc: Daniel Borkmann <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: [email protected]
Acked-by: David S. Miller <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
kernel/bpf/syscall.c
This page took 0.051227 seconds and 4 git commands to generate.