BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: bpf@vger.kernel.org, ast@kernel.org, andrii@kernel.org,
	daniel@iogearbox.net, 	martin.lau@linux.dev, kernel-team@fb.com,
	yonghong.song@linux.dev
Subject: Re: [PATCH bpf-next v3 3/3] selftests/bpf: check operations on untrusted ro pointers to mem
Date: Wed, 25 Jun 2025 12:46:14 -0700	[thread overview]
Message-ID: <8fa3ad36c2754bfa9a9b7366d47a1d2824c81ce1.camel@gmail.com> (raw)
In-Reply-To: <CAEf4BzYv1GKz81pVsCoeBBO5pdc76bkdg-AY6vA9sbbaXE3Eew@mail.gmail.com>

On Wed, 2025-06-25 at 12:38 -0700, Andrii Nakryiko wrote:
> On Wed, Jun 25, 2025 at 11:24 AM Eduard Zingerman <eddyz87@gmail.com> wrote:
> > 
> > The following cases are tested:
> > - it is ok to load memory at any offset from rdonly_untrusted_mem;
> > - rdonly_untrusted_mem offset/bounds are not tracked;
> > - writes into rdonly_untrusted_mem are forbidden;
> > - atomic operations on rdonly_untrusted_mem are forbidden;
> > - rdonly_untrusted_mem can't be passed as a memory argument of a
> >   helper of kfunc;
> > - it is ok to use PTR_TO_MEM and PTR_TO_BTF_ID in a same load
> >   instruction.
> > 
> > Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
> > ---
> >  .../bpf/prog_tests/mem_rdonly_untrusted.c     |   9 ++
> >  .../bpf/progs/mem_rdonly_untrusted.c          | 136 ++++++++++++++++++
> >  2 files changed, 145 insertions(+)
> >  create mode 100644 tools/testing/selftests/bpf/prog_tests/mem_rdonly_untrusted.c
> >  create mode 100644 tools/testing/selftests/bpf/progs/mem_rdonly_untrusted.c
> > 
> 
> Would be good to have a test that demonstrates loads of all
> combinations of signed/unsigned and 1/2/4/8 bytes. Maybe as a follow
> up?

Will respin.

  reply	other threads:[~2025-06-25 19:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-25 18:24 [PATCH bpf-next v3 0/3] bpf: allow void* cast using bpf_rdonly_cast() Eduard Zingerman
2025-06-25 18:24 ` [PATCH bpf-next v3 1/3] bpf: add bpf_features enum Eduard Zingerman
2025-06-25 18:24 ` [PATCH bpf-next v3 2/3] bpf: allow void* cast using bpf_rdonly_cast() Eduard Zingerman
2025-06-25 18:24 ` [PATCH bpf-next v3 3/3] selftests/bpf: check operations on untrusted ro pointers to mem Eduard Zingerman
2025-06-25 19:38   ` Andrii Nakryiko
2025-06-25 19:46     ` Eduard Zingerman [this message]
2025-06-25 22:14       ` Alexei Starovoitov
2025-06-25 19:39 ` [PATCH bpf-next v3 0/3] bpf: allow void* cast using bpf_rdonly_cast() Andrii Nakryiko
2025-06-25 22:20 ` 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=8fa3ad36c2754bfa9a9b7366d47a1d2824c81ce1.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=martin.lau@linux.dev \
    --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