From patchwork Fri Dec 15 23:05:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Olsa X-Patchwork-Id: 13495176 X-Patchwork-Delegate: bpf@iogearbox.net Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15B8318EB8 for ; Fri, 15 Dec 2023 23:05:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="n0VKAr8p" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BE4FC433C8; Fri, 15 Dec 2023 23:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702681508; bh=hveThWDdbyJf7djHgcj5zXJYyZ2QtXKRcgsgWbSpxqQ=; h=From:To:Cc:Subject:Date:From; b=n0VKAr8ps7iFtRct0mWP4W91F4uLD1atUa/OGs78Otf7txvYj5nDNwYpl+Yz5x1ny acjX2Cop7zzT47mLkNujdVD/VoIpWCSBnnb4cB0J92TbPA909BF/5ASOzqLZyFXNy3 REe05Hc4nsrqbgjHfdxAwWgvkQqa3rVmQpcUc76eZ7MiaCTZTky1npomNcrBsLwvHi zAzV6tWLeVenI8RFCvQuJ431kGxCmhIMVDarEbPsZQdAkx//xoZBhGs/iTWFR3M0dL fK5zHJ2pD4Ym8sPRz7LCmBG+WN4T4r65ca9ADl8OoedDqs8hoOBanKMyn2pHPM/tdu CQafF5j05qNnQ== From: Jiri Olsa To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: Pengfei Xu , Hou Tao , bpf@vger.kernel.org, Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Hou Tao Subject: [PATCHv2 bpf] bpf: Add missing BPF_LINK_TYPE invocations Date: Sat, 16 Dec 2023 00:05:02 +0100 Message-ID: <20231215230502.2769743-1-jolsa@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net 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 Tested-by: Pengfei Xu Acked-by: Hou Tao Signed-off-by: Jiri Olsa --- v2 changes: - move NETFILTER/TCX/NETKIT under CONFIG_NET - added tags 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..94baced5a1ad 100644 --- a/include/linux/bpf_types.h +++ b/include/linux/bpf_types.h @@ -142,9 +142,13 @@ BPF_LINK_TYPE(BPF_LINK_TYPE_ITER, iter) #ifdef CONFIG_NET BPF_LINK_TYPE(BPF_LINK_TYPE_NETNS, netns) BPF_LINK_TYPE(BPF_LINK_TYPE_XDP, xdp) +BPF_LINK_TYPE(BPF_LINK_TYPE_NETFILTER, netfilter) +BPF_LINK_TYPE(BPF_LINK_TYPE_TCX, tcx) +BPF_LINK_TYPE(BPF_LINK_TYPE_NETKIT, netkit) #endif #ifdef CONFIG_PERF_EVENTS 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_UPROBE_MULTI, uprobe_multi)