diff options
author | Peng Sun <sironhide0null@gmail.com> | 2019-02-26 17:15:37 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-05 17:37:58 +0300 |
commit | 7e50f6c7dc3006d3f92d668b61b2e75bec793ccf (patch) | |
tree | bf7a2cbea1f74cfa0e3d2689601af0045a4db368 /include/linux | |
parent | a184a9d6015ec0ec7ee7551d7157594ee89d02b2 (diff) | |
download | linux-7e50f6c7dc3006d3f92d668b61b2e75bec793ccf.tar.xz |
bpf: decrease usercnt if bpf_map_new_fd() fails in bpf_map_get_fd_by_id()
[ Upstream commit 781e62823cb81b972dc8652c1827205cda2ac9ac ]
In bpf/syscall.c, bpf_map_get_fd_by_id() use bpf_map_inc_not_zero()
to increase the refcount, both map->refcnt and map->usercnt. Then, if
bpf_map_new_fd() fails, should handle map->usercnt too.
Fixes: bd5f5f4ecb78 ("bpf: Add BPF_MAP_GET_FD_BY_ID")
Signed-off-by: Peng Sun <sironhide0null@gmail.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions