Skip to content

Commit fcb05fe

Browse files
olsajirigregkh
authored andcommitted
bpf: Add missing BPF_LINK_TYPE invocations
commit 117211a upstream. Pengfei Xu reported [1] Syzkaller/KASAN issue found in bpf_link_show_fdinfo. The reason is missing BPF_LINK_TYPE invocation for uprobe multi link and for several other links, adding that. [1] https://lore.kernel.org/bpf/ZXptoKRSLspnk2ie@xpf.sh.intel.com/ Fixes: 89ae89f ("bpf: Add multi uprobe link") Fixes: e420bed ("bpf: Add fd-based tcx multi-prog infra with link support") Fixes: 84601d6 ("bpf: add bpf_link support for BPF_NETFILTER programs") Fixes: 35dfaad ("netkit, bpf: Add bpf programmable net device") Reported-by: Pengfei Xu <pengfei.xu@intel.com> Signed-off-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Tested-by: Pengfei Xu <pengfei.xu@intel.com> Acked-by: Hou Tao <houtao1@huawei.com> Link: https://lore.kernel.org/bpf/20231215230502.2769743-1-jolsa@kernel.org Signed-off-by: Ignat Korchagin <ignat@cloudflare.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f70d849 commit fcb05fe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/linux/bpf_types.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,12 @@ BPF_LINK_TYPE(BPF_LINK_TYPE_ITER, iter)
142142
#ifdef CONFIG_NET
143143
BPF_LINK_TYPE(BPF_LINK_TYPE_NETNS, netns)
144144
BPF_LINK_TYPE(BPF_LINK_TYPE_XDP, xdp)
145+
BPF_LINK_TYPE(BPF_LINK_TYPE_NETFILTER, netfilter)
146+
BPF_LINK_TYPE(BPF_LINK_TYPE_TCX, tcx)
145147
#endif
146148
#ifdef CONFIG_PERF_EVENTS
147149
BPF_LINK_TYPE(BPF_LINK_TYPE_PERF_EVENT, perf)
148150
#endif
149151
BPF_LINK_TYPE(BPF_LINK_TYPE_KPROBE_MULTI, kprobe_multi)
150152
BPF_LINK_TYPE(BPF_LINK_TYPE_STRUCT_OPS, struct_ops)
153+
BPF_LINK_TYPE(BPF_LINK_TYPE_UPROBE_MULTI, uprobe_multi)

0 commit comments

Comments
 (0)