BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Nuoqi Gui" <gnq25@mails.tsinghua.edu.cn>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf 2/2] selftests/bpf: Cover rdonly_cast dynptr slice lifetime
Date: Mon, 15 Jun 2026 09:08:26 +0000	[thread overview]
Message-ID: <20260615090827.0C6CC1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260615-f01-09-rdonly-cast-dynptr-lifetime-v1-2-2dd0a369e153@mails.tsinghua.edu.cn>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Multi-line comments do not follow the BPF subsystem comment style guidelines. The opening `/*` must be on its own line.
--

commit 23e88c2468fdbcf78bd114cff5b73d79a87a4337
Author: Nuoqi Gui <gnq25@mails.tsinghua.edu.cn>

selftests/bpf: Cover rdonly_cast dynptr slice lifetime

This commit adds verifier tests for bpf_rdonly_cast() alias lifetime. It
covers casting a ringbuf dynptr slice, releasing the dynptr, reading through
the cast alias, and stack-overwrite invalidations.

> diff --git a/tools/testing/selftests/bpf/progs/dynptr_fail.c b/tools/testing/selftests/bpf/progs/dynptr_fail.c
> index b62773ce5219b..7ffe55ba28663 100644
> --- a/tools/testing/selftests/bpf/progs/dynptr_fail.c
> +++ b/tools/testing/selftests/bpf/progs/dynptr_fail.c

[ ... ]

> +/* A read-only cast alias from an overwritten dynptr should be invalidated
> + * even when a clone still holds the underlying reference.
> + */
> +SEC("?raw_tp")
> +__failure __msg("invalid mem access 'scalar'")
> +int dynptr_rdonly_cast_slice_after_overwrite(void *ctx)

[Severity: Low]
This isn't a bug, but does this multi-line comment follow the preferred
BPF subsystem style? The opening /* is typically expected to be on its
own line.

[ ... ]

> +/* A read-only cast alias from a clone should remain valid after overwriting
> + * the original dynptr while the clone still holds the reference.
> + */
> +SEC("?raw_tp")
> +__success
> +int dynptr_rdonly_cast_clone_slice_after_parent_overwrite(void *ctx)

[Severity: Low]
This isn't a bug, but similar to the comment above, should the opening /*
be placed on its own line to match the expected multi-line comment style
for the BPF subsystem?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260615-f01-09-rdonly-cast-dynptr-lifetime-v1-0-2dd0a369e153@mails.tsinghua.edu.cn?part=2

  reply	other threads:[~2026-06-15  9:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-15  8:57 [PATCH bpf 0/2] bpf: Preserve rdonly_cast dynptr slice lifetime Nuoqi Gui
2026-06-15  8:57 ` [PATCH bpf 1/2] bpf: Preserve dynptr slice lifetime across rdonly_cast Nuoqi Gui
2026-06-15 11:24   ` sashiko-bot
2026-06-15  8:57 ` [PATCH bpf 2/2] selftests/bpf: Cover rdonly_cast dynptr slice lifetime Nuoqi Gui
2026-06-15  9:08   ` sashiko-bot [this message]
2026-06-15  9:40 ` [PATCH bpf 0/2] bpf: Preserve " Kumar Kartikeya Dwivedi
2026-06-15 17:24   ` Eduard Zingerman

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=20260615090827.0C6CC1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=gnq25@mails.tsinghua.edu.cn \
    --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