From: bot+bpf-ci@kernel.org
To: janten@gmail.com,bpf@vger.kernel.org
Cc: ast@kernel.org,daniel@iogearbox.net,andrii@kernel.org,eddyz87@gmail.com,memxor@gmail.com,martin.lau@linux.dev,song@kernel.org,yonghong.song@linux.dev,jolsa@kernel.org,emil@etsalapatis.com,ihor.solodrai@linux.dev,john.fastabend@gmail.com,davem@davemloft.net,edumazet@kernel.org,kuba@kernel.org,pabeni@redhat.com,horms@kernel.org,jakub@cloudflare.com,jiayuan.chen@linux.dev,kuniyu@google.com,willemb@google.com,shuah@kernel.org,netdev@vger.kernel.org,linux-kernel@vger.kernel.org,linux-kselftest@vger.kernel.org,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,mason@kernel.org,ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf 1/2] bpf: Revalidate iterator programs on link update
Date: Thu, 8 Oct 2026 17:13:25 +0000 (UTC) [thread overview]
Message-ID: <960fca850e45c39ab84ddde9b0063a89dc44d9faf0e3e750fec9e9d891f773a0@mail.kernel.org> (raw)
In-Reply-To: <20261008161309.8179-2-janten@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2122 bytes --]
> bpf: Revalidate iterator programs on link update
TL;DR: Nit only: Documentation/bpf/bpf_iterators.rst may need updating for the
new validate_target callback in struct bpf_iter_reg and for when it is invoked
(BPF_LINK_UPDATE only). No code problems reported.
> diff --git a/include/linux/bpf.h b/include/linux/bpf.h
> index 0ecb9418dfbd..5aa786eba3ea 100644
> --- a/include/linux/bpf.h
> +++ b/include/linux/bpf.h
[ ... ]
> @@ -3024,6 +3026,7 @@ enum bpf_iter_feature {
> struct bpf_iter_reg {
> const char *target;
> bpf_iter_attach_target_t attach_target;
> + bpf_iter_validate_target_t validate_target;
> bpf_iter_detach_target_t detach_target;
> bpf_iter_show_fdinfo_t show_fdinfo;
> bpf_iter_fill_link_info_t fill_link_info;
This isn't a bug, but should Documentation/bpf/bpf_iterators.rst be updated
for the new member?
That file carries a copy of struct bpf_iter_reg that listed attach_target
and detach_target exactly as they appeared in this header before the patch:
bpf_iter_attach_target_t attach_target;
bpf_iter_detach_target_t detach_target;
It now lacks validate_target.
The field table in the same file also describes the callbacks as:
attach_target and detach_target
Allows for target specific link_create action since some targets may
need special processing. Called during the user space link_create
stage.
Nothing there says that validate_target is invoked only from
bpf_iter_link_replace() (BPF_LINK_UPDATE), and that a target's
attach_target has to call its validator itself at link_create time, since
bpf_iter_link_attach() does not call it generically.
A new iterator author working from the documentation would not learn that
program-dependent checks belong in validate_target as well as in
attach_target.
Should the struct listing and the field table describe validate_target and
when it is invoked?
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/37809581821
next prev parent reply other threads:[~2026-10-08 17:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 16:13 [PATCH bpf 0/2] bpf: Fix iterator link update target validation Jan-Gerd Tenberge
2026-10-08 16:13 ` [PATCH bpf 1/2] bpf: Revalidate iterator programs on link update Jan-Gerd Tenberge
2026-10-08 17:13 ` bot+bpf-ci [this message]
2026-10-08 16:13 ` [PATCH bpf 2/2] selftests/bpf: Test iterator link target validation Jan-Gerd Tenberge
2026-10-16 0:31 ` [PATCH bpf 0/2] bpf: Fix iterator link update " Alexei Starovoitov
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=960fca850e45c39ab84ddde9b0063a89dc44d9faf0e3e750fec9e9d891f773a0@mail.kernel.org \
--to=bot+bpf-ci@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=eddyz87@gmail.com \
--cc=edumazet@kernel.org \
--cc=emil@etsalapatis.com \
--cc=horms@kernel.org \
--cc=ihor.solodrai@linux.dev \
--cc=jakub@cloudflare.com \
--cc=janten@gmail.com \
--cc=jiayuan.chen@linux.dev \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@kernel.org \
--cc=martin.lau@linux.dev \
--cc=mason@kernel.org \
--cc=memxor@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=willemb@google.com \
--cc=yonghong.song@linux.dev \
/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
all inboxes | Powered by JetHome®