Re: [PATCH] selftests/bpf: replace bpf_probe_read_kernel with direct access

From: Suchit Karunakaran

Date: Thu Apr 23 2026 - 02:58:55 EST


On Thu, 23 Apr 2026 at 02:51, Alexei Starovoitov
<alexei.starovoitov@xxxxxxxxx> wrote:
>
> On Wed, Apr 22, 2026 at 11:38 AM Suchit Karunakaran
> <suchitkarunakaran@xxxxxxxxx> wrote:
> >
> > Use direct field access instead of bpf_probe_read_kernel() for
> > nlk->groups[0] and inode->i_ino, and clean up related code.
> >
> > Removes obsolete FIXME comments and unused variable.
> >
> > Signed-off-by: Suchit Karunakaran <suchitkarunakaran@xxxxxxxxx>
> > ---
> > .../testing/selftests/bpf/progs/bpf_iter_netlink.c | 13 ++-----------
> > 1 file changed, 2 insertions(+), 11 deletions(-)
> >
> > diff --git a/tools/testing/selftests/bpf/progs/bpf_iter_netlink.c b/tools/testing/selftests/bpf/progs/bpf_iter_netlink.c
> > index 00b2ceae81fb..5930bf8899d2 100644
> > --- a/tools/testing/selftests/bpf/progs/bpf_iter_netlink.c
> > +++ b/tools/testing/selftests/bpf/progs/bpf_iter_netlink.c
> > @@ -17,7 +17,6 @@ int dump_netlink(struct bpf_iter__netlink *ctx)
> > struct seq_file *seq = ctx->meta->seq;
> > struct netlink_sock *nlk = ctx->sk;
> > unsigned long group, ino;
> > - struct inode *inode;
> > struct socket *sk;
> > struct sock *s;
> >
> > @@ -35,10 +34,7 @@ int dump_netlink(struct bpf_iter__netlink *ctx)
> > if (!nlk->groups) {
> > group = 0;
> > } else {
> > - /* FIXME: temporary use bpf_probe_read_kernel here, needs
> > - * verifier support to do direct access.
> > - */
> > - bpf_probe_read_kernel(&group, sizeof(group), &nlk->groups[0]);
>
> Please stop sending patches to remove TODO and FIXME.
>
> pw-bot: cr

Sorry about that. I'll test it more rigorously next time and ensure
the patch is sensible.