From: Sun Jian <sun.jian.kdev@gmail.com>
To: Andrii Nakryiko <andrii@kernel.org>, Shuah Khan <shuah@kernel.org>
Cc: Eduard Zingerman <eddyz87@gmail.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
bpf@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org, Sun Jian <sun.jian.kdev@gmail.com>
Subject: [PATCH v2 0/2] selftests/bpf: make probe_user safe for parallel runs
Date: Thu, 26 Feb 2026 17:31:30 +0800 [thread overview]
Message-ID: <20260226093132.437206-1-sun.jian.kdev@gmail.com> (raw)
The probe_user selftest attaches ksyscall hooks for connect() (and
socketcall() on s390). Historically it could corrupt other tests
calling connect() in parallel, causing flaky failures.
This series confines the instrumentation to the current test process only,
and then drops the serial restriction and removes the stale TODO.
v1: <https://lore.kernel.org/all/cover.1772079741.git.sun.jian.kdev@gmail.com/>
Changes in v2:
- Replace pid_map with a global .bss struct initialized via
bpf_map__set_initial_value() before bpf_object__load().
- Add bpf_map__value_size() check for the .bss map to catch
layout mismatch.
- Move PID filtering into handle_sys_connect_common() (covers both
connect() and s390 socketcall() paths).
- Keep existing validation flow intact (bridge via tmp buffer).
Tested:
- cd .kselftest-out/selftests-bpf
./test_progs -t probe_user -v
- cd .kselftest-out/selftests-bpf
./test_progs -j"$(nproc)" -t probe_user -v
Sun Jian (2):
selftests/bpf: probe_user: filter by pid to avoid cross-test
interference
selftests/bpf: probe_user: drop serial restriction
.../selftests/bpf/prog_tests/probe_user.c | 30 +++++++++++++++++--
.../selftests/bpf/progs/test_probe_user.c | 13 ++++++--
2 files changed, 38 insertions(+), 5 deletions(-)
base-commit: 7dff99b354601dd01829e1511711846e04340a69
--
2.43.0
next reply other threads:[~2026-02-26 9:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 9:31 Sun Jian [this message]
2026-02-26 9:31 ` [PATCH v2 1/2] selftests/bpf: probe_user: filter by pid to avoid cross-test interference Sun Jian
2026-02-26 15:18 ` Mykyta Yatsenko
2026-03-05 23:10 ` Andrii Nakryiko
2026-02-26 9:31 ` [PATCH v2 2/2] selftests/bpf: probe_user: drop serial restriction Sun Jian
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=20260226093132.437206-1-sun.jian.kdev@gmail.com \
--to=sun.jian.kdev@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
/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