public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Ihor Solodrai <ihor.solodrai@linux.dev>
To: Emil Tsalapatis <emil@etsalapatis.com>,
	Weiming Shi <bestswngs@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>
Cc: Martin KaFai Lau <martin.lau@linux.dev>,
	Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
	Jiri Olsa <jolsa@kernel.org>, Barret Rhoden <brho@google.com>,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
	Xiang Mei <xmei5@asu.edu>
Subject: Re: [PATCH bpf v2 2/2] selftests/bpf: Add test for arena VMA use-after-free on fork
Date: Fri, 24 Apr 2026 13:01:52 -0700	[thread overview]
Message-ID: <635af96f-3a8e-4d39-9df5-8c66945bf9e5@linux.dev> (raw)
In-Reply-To: <DHQI86CY1QDQ.16RMS5QSX99EC@etsalapatis.com>

On 4/11/26 10:33 AM, Emil Tsalapatis wrote:
> On Sat Apr 11, 2026 at 7:29 AM EDT, Weiming Shi wrote:
>> Add a selftest that reproduces the arena VMA use-after-free fixed in
>> the previous commit. The test creates an arena, mmaps it, allocates
>> pages via BPF, forks, has the parent munmap the arena, then has the
>> child call bpf_arena_free_pages. Without the fix this triggers a
>> KASAN slab-use-after-free in zap_page_range_single.
>>
>> Signed-off-by: Weiming Shi <bestswngs@gmail.com>
>> ---
>>  .../selftests/bpf/prog_tests/arena_fork.c     | 86 +++++++++++++++++++
>>  .../testing/selftests/bpf/progs/arena_fork.c  | 41 +++++++++
>>  2 files changed, 127 insertions(+)
>>  create mode 100644 tools/testing/selftests/bpf/prog_tests/arena_fork.c
>>  create mode 100644 tools/testing/selftests/bpf/progs/arena_fork.c
>>
> 
> The test doesn't work for me as advertised. Does it fail for you under
> vmtest without patch 1/2?
> 
> The test doesn't fail on base vmtest for me, even without the previous patch,
> because KASAN isn't turned on for the CI. With KASAN the test triggers
> the splat just fine. 
> 
> Should we maybe turn on KASAN and panic_on_warn by default on vmtest?

Hi Emil,

I just noticed this message. BPF CI has KASAN enabled by default
(disabled only on s390x) for almost a year now [1].  Did the test fail
locally for you, but not on CI?

[1] https://github.com/kernel-patches/vmtest/commit/5db11d295888c3f048021a15c3a8a9875c8612c3

> 
>> [...]
> 


  reply	other threads:[~2026-04-24 20:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-11 11:29 [PATCH bpf v2 0/2] bpf: Fix arena VMA use-after-free on fork Weiming Shi
2026-04-11 11:29 ` [PATCH bpf v2 1/2] bpf: Fix use-after-free of arena VMA " Weiming Shi
2026-04-11 17:57   ` Emil Tsalapatis
2026-04-11 11:29 ` [PATCH bpf v2 2/2] selftests/bpf: Add test for arena VMA use-after-free " Weiming Shi
2026-04-11 17:33   ` Emil Tsalapatis
2026-04-24 20:01     ` Ihor Solodrai [this message]
2026-04-24 20:16       ` Emil Tsalapatis

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=635af96f-3a8e-4d39-9df5-8c66945bf9e5@linux.dev \
    --to=ihor.solodrai@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bestswngs@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=brho@google.com \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=xmei5@asu.edu \
    --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