public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] selftests/bpf: make probe_user safe for parallel runs
@ 2026-02-26  9:31 Sun Jian
  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  9:31 ` [PATCH v2 2/2] selftests/bpf: probe_user: drop serial restriction Sun Jian
  0 siblings, 2 replies; 5+ messages in thread
From: Sun Jian @ 2026-02-26  9:31 UTC (permalink / raw)
  To: Andrii Nakryiko, Shuah Khan
  Cc: Eduard Zingerman, Alexei Starovoitov, Daniel Borkmann, bpf,
	linux-kselftest, linux-kernel, Sun Jian

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-03-05 23:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-26  9:31 [PATCH v2 0/2] selftests/bpf: make probe_user safe for parallel runs Sun Jian
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox