summaryrefslogtreecommitdiff
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
authorHou Tao <houtao1@huawei.com>2023-12-04 22:04:21 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-02-05 20:14:20 +0000
commita9bf3a490e6a1aefc04daa0a7fb91bbc331c0be8 (patch)
tree35713f4f48aeb648870429fdbd18ca83bc8bb7d4 /kernel/sysctl.c
parent483cb92334cd7f1d5387dccc0ab5d595d27a669d (diff)
bpf: Set need_defer as false when clearing fd array during map free
[ Upstream commit 79d93b3c6ffd79abcd8e43345980aa1e904879c4 ] Both map deletion operation, map release and map free operation use fd_array_map_delete_elem() to remove the element from fd array and need_defer is always true in fd_array_map_delete_elem(). For the map deletion operation and map release operation, need_defer=true is necessary, because the bpf program, which accesses the element in fd array, may still alive. However for map free operation, it is certain that the bpf program which owns the fd array has already been exited, so setting need_defer as false is appropriate for map free operation. So fix it by adding need_defer parameter to bpf_fd_array_map_clear() and adding a new helper __fd_array_map_delete_elem() to handle the map deletion, map release and map free operations correspondingly. Signed-off-by: Hou Tao <houtao1@huawei.com> Link: https://lore.kernel.org/r/20231204140425.1480317-4-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel/sysctl.c')
0 files changed, 0 insertions, 0 deletions