All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] selftests/bpf: make probe_user safe for parallel runs
@ 2026-02-26  4:29 Sun Jian
  2026-02-26  4:29 ` [PATCH 1/2] selftests/bpf: probe_user: filter by pid to avoid cross-test interference Sun Jian
  2026-02-26  4:29 ` [PATCH 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  4:29 UTC (permalink / raw)
  To: Andrii Nakryiko, Shuah Khan
  Cc: bpf, linux-kselftest, Alexei Starovoitov, Daniel Borkmann,
	Sun Jian

The probe_user selftest attaches ksyscall hooks for connect() (and
socketcall() on s390). Historically this could corrupt other tests
calling connect(), which is why the test was marked as serial and
carried a TODO warning about cross-test corruption.

This series makes the test safe for parallel execution by filtering the
BPF-side instrumentation to the current test process only, and then
drops the serial restriction and the stale TODO comment.

Patch 1/2 adds a single-entry pid_map and checks current tgid (process
ID) before calling bpf_probe_read_user()/bpf_probe_write_user(). The
userspace test writes its PID into the map after loading the object.

Patch 2/2 drops the serial_ prefix and removes the outdated TODO, since
cross-test interference is no longer possible.

Tested on x86_64 (clang):
  ./test_progs -t probe_user -v
  ./test_progs -j$(nproc) -t probe_user

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     | 16 +++++++++++---
 .../selftests/bpf/progs/test_probe_user.c     | 22 +++++++++++++++++++
 2 files changed, 35 insertions(+), 3 deletions(-)


base-commit: 7dff99b354601dd01829e1511711846e04340a69
-- 
2.43.0


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

end of thread, other threads:[~2026-02-26  5:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-26  4:29 [PATCH 0/2] selftests/bpf: make probe_user safe for parallel runs Sun Jian
2026-02-26  4:29 ` [PATCH 1/2] selftests/bpf: probe_user: filter by pid to avoid cross-test interference Sun Jian
2026-02-26  4:56   ` Alexei Starovoitov
2026-02-26  5:08   ` bot+bpf-ci
2026-02-26  4:29 ` [PATCH 2/2] selftests/bpf: probe_user: drop serial restriction Sun Jian

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.