BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kumar Kartikeya Dwivedi" <memxor@gmail.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v3 3/4] selftests/bpf: Exercise unsafe obj drops from tracing progs
Date: Tue, 09 Jun 2026 20:36:30 +0000	[thread overview]
Message-ID: <20260609203630.E3BF61F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260609202548.3571690-4-memxor@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The test `task_kfunc_obj_drop_nmi_with_kptr` does not test NMI tracing programs as claimed by the commit message and its function name. Instead, it uses `SEC("tp_btf/task_newtask")`, which makes it a standard tracing program. Furthermore, because it fails at load-time for the exact same verifier reason as `task_kfunc_obj_drop_with_kptr`, the second test provides redundant coverage and leaves the intended NMI tracing context (`BPF_PROG_TYPE_PERF_EVENT`) completely untested.
--

commit e2b410eb90d404473252178d121d1547bd924299
Author: Kumar Kartikeya Dwivedi <memxor@gmail.com>

selftests/bpf: Exercise unsafe obj drops from tracing progs

This commit adds task_kfunc failure cases for bpf_obj_drop on local
objects with referenced kptr fields. It intends to verify that the
verifier rejects these operations from both standard tracing and NMI
tracing programs.

> diff --git a/tools/testing/selftests/bpf/progs/task_kfunc_failure.c b/tools/testing/selftests/bpf/progs/task_kfunc_failure.c
> --- a/tools/testing/selftests/bpf/progs/task_kfunc_failure.c
> +++ b/tools/testing/selftests/bpf/progs/task_kfunc_failure.c
[ ... ]
> +SEC("tp_btf/task_newtask")
> +__failure __msg("bpf_obj_drop cannot be used in tracing programs on types with NMI unsafe fields")
> +int BPF_PROG(task_kfunc_obj_drop_with_kptr, struct task_struct *task, u64 clone_flags)
> +{
[ ... ]
> +}
> +
> +SEC("tp_btf/task_newtask")
> +__failure __msg("bpf_obj_drop cannot be used in tracing programs on types with NMI unsafe fields")
> +int BPF_PROG(task_kfunc_obj_drop_nmi_with_kptr, struct task_struct *task,
> +	     u64 clone_flags)

[Severity: Medium]
Does this test actually exercise the NMI tracing context as intended?

The function is named task_kfunc_obj_drop_nmi_with_kptr and the commit
message mentions NMI tracing programs, but the section used here is
SEC("tp_btf/task_newtask"). Should this be using an NMI-specific section
like SEC("perf_event") instead?

Because this uses the same tracing section as the previous test, it fails at
load-time for the exact same verifier reason as task_kfunc_obj_drop_with_kptr,
providing redundant coverage and leaving the NMI context untested.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260609202548.3571690-1-memxor@gmail.com?part=3

  reply	other threads:[~2026-06-09 20:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09 20:25 [PATCH bpf-next v3 0/4] Fix kptr dtor deadlock Kumar Kartikeya Dwivedi
2026-06-09 20:25 ` [PATCH bpf-next v3 1/4] bpf: Reject bpf_obj_drop() from tracing progs Kumar Kartikeya Dwivedi
2026-06-09 20:58   ` bot+bpf-ci
2026-06-09 20:25 ` [PATCH bpf-next v3 2/4] bpf: Cancel special fields on map value recycle Kumar Kartikeya Dwivedi
2026-06-09 20:44   ` sashiko-bot
2026-06-09 21:09   ` bot+bpf-ci
2026-06-09 20:25 ` [PATCH bpf-next v3 3/4] selftests/bpf: Exercise unsafe obj drops from tracing progs Kumar Kartikeya Dwivedi
2026-06-09 20:36   ` sashiko-bot [this message]
2026-06-09 21:09   ` bot+bpf-ci
2026-06-09 20:25 ` [PATCH bpf-next v3 4/4] selftests/bpf: Exercise kptr map update lifetime Kumar Kartikeya Dwivedi
2026-06-09 20:51   ` sashiko-bot
2026-06-10 15:10 ` [PATCH bpf-next v3 0/4] Fix kptr dtor deadlock patchwork-bot+netdevbpf

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=20260609203630.E3BF61F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=memxor@gmail.com \
    --cc=sashiko-reviews@lists.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