diff options
author | Peng Sun <sironhide0null@gmail.com> | 2019-02-27 22:36:25 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-05 15:38:00 +0100 |
commit | ebf233fd40bfc70e53ac9ba6b46ec7b3439c3da1 (patch) | |
tree | de550b9dbf033be578cde0a55e89dd1a4f7768f0 /Kbuild | |
parent | 4e4a0cf997f8c40747bdf6465070f2bc04dcdc18 (diff) |
bpf: drop refcount if bpf_map_new_fd() fails in map_create()
[ Upstream commit 352d20d611414715353ee65fc206ee57ab1a6984 ]
In bpf/syscall.c, map_create() first set map->usercnt to 1, a file
descriptor is supposed to return to userspace. When bpf_map_new_fd()
fails, drop the refcount.
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: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'Kbuild')
0 files changed, 0 insertions, 0 deletions