]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf: fix panic in stack_map_get_build_id() on i386 and arm32
authorSong Liu <songliubraving@fb.com>
Tue, 8 Jan 2019 22:20:44 +0000 (14:20 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Feb 2019 09:09:46 +0000 (10:09 +0100)
commita4dc1ce0730408b45e84728982511e9ebc984d57
tree1adaa8d3f2b4b70f08d8d58637d3f5ffd762a25a
parent5938484d91a71b13e64aecd8d94e72cd04408d0c
bpf: fix panic in stack_map_get_build_id() on i386 and arm32

[ Upstream commit beaf3d1901f4ea46fbd5c9d857227d99751de469 ]

As Naresh reported, test_stacktrace_build_id() causes panic on i386 and
arm32 systems. This is caused by page_address() returns NULL in certain
cases.

This patch fixes this error by using kmap_atomic/kunmap_atomic instead
of page_address.

Fixes: 615755a77b24 (" bpf: extend stackmap to save binary_build_id+offset instead of address")
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/bpf/stackmap.c