Re: [PATCH bpf] bpf: Add missing BPF_LINK_TYPE invocations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 15, 2023 at 1:18 AM Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
>
> 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@xxxxxxxxxxxxxxxx/
>
> Fixes: 89ae89f53d20 ("bpf: Add multi uprobe link")
> Fixes: e420bed02507 ("bpf: Add fd-based tcx multi-prog infra with link support")
> Fixes: 84601d6ee68a ("bpf: add bpf_link support for BPF_NETFILTER programs")
> Fixes: 35dfaad7188c ("netkit, bpf: Add bpf programmable net device")
> Reported-by: Pengfei Xu <pengfei.xu@xxxxxxxxx>
> Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
> ---
>  include/linux/bpf_types.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/include/linux/bpf_types.h b/include/linux/bpf_types.h
> index fc0d6f32c687..38cbdaec6bdf 100644
> --- a/include/linux/bpf_types.h
> +++ b/include/linux/bpf_types.h
> @@ -148,3 +148,7 @@ BPF_LINK_TYPE(BPF_LINK_TYPE_PERF_EVENT, perf)
>  #endif
>  BPF_LINK_TYPE(BPF_LINK_TYPE_KPROBE_MULTI, kprobe_multi)
>  BPF_LINK_TYPE(BPF_LINK_TYPE_STRUCT_OPS, struct_ops)
> +BPF_LINK_TYPE(BPF_LINK_TYPE_NETFILTER, netfilter)
> +BPF_LINK_TYPE(BPF_LINK_TYPE_TCX, tcx)
> +BPF_LINK_TYPE(BPF_LINK_TYPE_UPROBE_MULTI, uprobe_multi)
> +BPF_LINK_TYPE(BPF_LINK_TYPE_NETKIT, netkit)

let's reorder keeping UPROBE_MULTI first or last and then guard TCX,
NETFILTER, and NETKIT with CONFIG_NET? This is based on similar guards
in BPF_LINK_CREATE handling.

> --
> 2.43.0
>





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux