]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf: zero out build_id for BPF_STACK_BUILD_ID_IP
authorStanislav Fomichev <sdf@google.com>
Wed, 16 Jan 2019 22:03:16 +0000 (14:03 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Feb 2019 09:09:50 +0000 (10:09 +0100)
commit537158331aff36514a64c0774d9f2789e58f93cd
tree6ac62ef4d203c9b95b60a670634f7236e1839822
parent0dfb08353cbb4e7330ff6c130dfa59ca6e8c1ffc
bpf: zero out build_id for BPF_STACK_BUILD_ID_IP

[ Upstream commit 4af396ae4836c4ecab61e975b8e61270c551894d ]

When returning BPF_STACK_BUILD_ID_IP from stack_map_get_build_id_offset,
make sure that build_id field is empty. Since we are using percpu
free list, there is a possibility that we might reuse some previous
bpf_stack_build_id with non-zero build_id.

Fixes: 615755a77b24 ("bpf: extend stackmap to save binary_build_id+offset instead of address")
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/bpf/stackmap.c