]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Fix map permissions check
authorAnton Protopopov <a.s.protopopov@gmail.com>
Wed, 27 May 2020 18:56:59 +0000 (18:56 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 1 Jun 2020 21:38:21 +0000 (14:38 -0700)
commitda30f7ed5483c5a92d77e4b8ca56b06ed12eef49
tree7e4c0c652d27f92872fc680e3dd06fb67548ec75
parent1bf6adb17597983c844edfa65c522522c92bf573
bpf: Fix map permissions check

The map_lookup_and_delete_elem() function should check for both FMODE_CAN_WRITE
and FMODE_CAN_READ permissions because it returns a map element to user space.

Fixes: 2b2c3330962b ("bpf: add MAP_LOOKUP_AND_DELETE_ELEM syscall")
Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200527185700.14658-5-a.s.protopopov@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/syscall.c