]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Fix error return code in map_lookup_and_delete_elem()
authorWei Yongjun <weiyongjun1@huawei.com>
Thu, 30 Apr 2020 08:18:51 +0000 (08:18 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 30 Apr 2020 14:19:08 +0000 (16:19 +0200)
commit506998fa261031d65bb187870574cd88aacc2eda
tree9b4fe3e64486b14b38c6598a089e5ca6bc5107cb
parentda4b4f93b63640b9f57d4232272923153bcf24bb
bpf: Fix error return code in map_lookup_and_delete_elem()

Fix to return negative error code -EFAULT from the copy_to_user() error
handling case instead of 0, as done elsewhere in this function.

Fixes: 2b2c3330962b ("bpf: add MAP_LOOKUP_AND_DELETE_ELEM syscall")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200430081851.166996-1-weiyongjun1@huawei.com
kernel/bpf/syscall.c