]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Fix error usage of map_fd and fdget() in generic_map_update_batch()
authorXu Kuohai <xukuohai@huawei.com>
Tue, 19 Oct 2021 03:29:34 +0000 (03:29 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 23 Oct 2021 00:23:54 +0000 (17:23 -0700)
commit464ca236fa360df1c7b74418fc7d51ae1708e5d9
tree60783626fd08c9c63907db85ef69294c4eb1a26a
parent2d518efd26f7647cfa110a7a3a80eca17c13e3f6
bpf: Fix error usage of map_fd and fdget() in generic_map_update_batch()

1. The ufd in generic_map_update_batch() should be read from batch.map_fd;
2. A call to fdget() should be followed by a symmetric call to fdput().

Fixes: 14c94bcd0a19 ("bpf: Add generic support for update and delete batch ops")
Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211019032934.1210517-1-xukuohai@huawei.com
kernel/bpf/syscall.c