All of lore.kernel.org
 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 v2 3/4] selftests/bpf: Exercise unsafe obj drops from tracing progs
Date: Tue, 09 Jun 2026 10:02:44 +0000	[thread overview]
Message-ID: <20260609100245.28A401F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260609093719.2858096-4-memxor@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The selftest `task_kfunc_obj_drop_nmi_with_kptr` uses the x86-only `nmi_handler` tracepoint, breaking the test suite on other architectures.
--

commit 1282fb89cc1ac86a478ae0747dc71f01a3bfc729
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 introduces tests for tracing and
NMI tracing programs to ensure they are rejected by the verifier.

> 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/nmi_handler")
> +__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, void *handler, s64 delta_ns,
> +	     int handled)

[Severity: Medium]
Will this break the selftest suite on non-x86 architectures?

The nmi_handler tracepoint is only defined and instantiated on x86
architectures. On non-x86 architectures like ARM64 or RISC-V, libbpf will
fail to resolve the BTF ID for this tracepoint, and the BPF program load
will abort before the verifier is invoked.

Consequently, the test_loader framework will not find the expected verifier
failure message in the log, causing the test to incorrectly report as failed.
Is there an architecture-independent tracepoint that could be used instead,
or should this test be skipped on non-x86 platforms?

> +{
> +	struct __tasks_kfunc_map_value *local;
> +	struct task_struct *task, *acquired, *old;

[ ... ]

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

  reply	other threads:[~2026-06-09 10:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09  9:37 [PATCH bpf-next v2 0/4] Fix kptr dtor deadlock Kumar Kartikeya Dwivedi
2026-06-09  9:37 ` [PATCH bpf-next v2 1/4] bpf: Reject bpf_obj_drop() from tracing progs Kumar Kartikeya Dwivedi
2026-06-09 10:05   ` bot+bpf-ci
2026-06-09 13:31   ` Mykyta Yatsenko
2026-06-09 14:08     ` Kumar Kartikeya Dwivedi
2026-06-09 16:14       ` Justin Suess
2026-06-09 18:17       ` Alexei Starovoitov
2026-06-09  9:37 ` [PATCH bpf-next v2 2/4] bpf: Cancel special fields on map value recycle Kumar Kartikeya Dwivedi
2026-06-09  9:55   ` sashiko-bot
2026-06-09 10:51   ` Mykyta Yatsenko
2026-06-09  9:37 ` [PATCH bpf-next v2 3/4] selftests/bpf: Exercise unsafe obj drops from tracing progs Kumar Kartikeya Dwivedi
2026-06-09 10:02   ` sashiko-bot [this message]
2026-06-09  9:37 ` [PATCH bpf-next v2 4/4] selftests/bpf: Exercise kptr map update lifetime Kumar Kartikeya Dwivedi
2026-06-09 10:20   ` sashiko-bot

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=20260609100245.28A401F00893@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.