]> git.baikalelectronics.ru Git - kernel.git/commit
bpf/btf: Fix is_int_ptr()
authorFeng Zhou <zhoufeng.zf@bytedance.com>
Mon, 10 Apr 2023 08:59:07 +0000 (16:59 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:21 +0000 (23:03 +0900)
commitcc389619d9b1576b49a148ee5d713fa5b5c736e7
tree2cd79e952b813b964a645ef73dcab8909656e44b
parentad1a139ab3a26791306006532d5ca186ce2683a7
bpf/btf: Fix is_int_ptr()

[ Upstream commit 91f2dc6838c19342f7f2993627c622835cc24890 ]

When tracing a kernel function with arg type is u32*, btf_ctx_access()
would report error: arg2 type INT is not a struct.

The commit e29276e28db2 ("bpf: Allow access to int pointer arguments
in tracing programs") added support for int pointer, but did not skip
modifiers before checking it's type. This patch fixes it.

Fixes: e29276e28db2 ("bpf: Allow access to int pointer arguments in tracing programs")
Co-developed-by: Chengming Zhou <zhouchengming@bytedance.com>
Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
Signed-off-by: Feng Zhou <zhoufeng.zf@bytedance.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/bpf/20230410085908.98493-2-zhoufeng.zf@bytedance.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/bpf/btf.c