BPF List
 help / color / mirror / Atom feed
From: Hou Tao <houtao@huaweicloud.com>
To: Jiri Olsa <jolsa@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>
Cc: Pengfei Xu <pengfei.xu@intel.com>,
	bpf@vger.kernel.org, Martin KaFai Lau <kafai@fb.com>,
	Song Liu <songliubraving@fb.com>, Yonghong Song <yhs@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@chromium.org>,
	Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>
Subject: Re: [PATCH bpf] bpf: Add missing BPF_LINK_TYPE invocations
Date: Fri, 15 Dec 2023 18:10:55 +0800	[thread overview]
Message-ID: <841653bd-a32f-71db-b26a-e44fa6370358@huaweicloud.com> (raw)
In-Reply-To: <20231215091826.2467281-1-jolsa@kernel.org>



On 12/15/2023 5:18 PM, Jiri Olsa 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@xpf.sh.intel.com/
>
> 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@intel.com>
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---

Some BPF_LINK_TYPE() definitions below can be guarded by CONFIG_xx
macro, but I think it doesn't matter here, because these definitions are
only used in bpf_link_type_strs(), so

Acked-by: Hou Tao <houtao1@huawei.com>

>  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)


  reply	other threads:[~2023-12-15 10:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-15  9:18 [PATCH bpf] bpf: Add missing BPF_LINK_TYPE invocations Jiri Olsa
2023-12-15 10:10 ` Hou Tao [this message]
2023-12-15 21:26   ` Jiri Olsa
2023-12-15 13:11 ` Pengfei Xu
2023-12-15 21:18 ` Andrii Nakryiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=841653bd-a32f-71db-b26a-e44fa6370358@huaweicloud.com \
    --to=houtao@huaweicloud.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kafai@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=pengfei.xu@intel.com \
    --cc=sdf@google.com \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox