]> git.baikalelectronics.ru Git - kernel.git/commit
bpf/syscall: allow key to be null in map functions
authorMauricio Vasquez B <mauricio.vasquez@polito.it>
Thu, 18 Oct 2018 13:16:14 +0000 (15:16 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 19 Oct 2018 20:24:31 +0000 (13:24 -0700)
commit87206e34eb9accb5e38b7d0341ff5894e3e86f3f
tree7e6d5a147223d0816abf33e881bd0bb0ea511904
parent06d23c4803c9b5f0ae2f6c3747d1b162ad6c5686
bpf/syscall: allow key to be null in map functions

This commit adds the required logic to allow key being NULL
in case the key_size of the map is 0.

A new __bpf_copy_key function helper only copies the key from
userpsace when key_size != 0, otherwise it enforces that key must be
null.

Signed-off-by: Mauricio Vasquez B <mauricio.vasquez@polito.it>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/syscall.c