mbox series

[v2,bpf,0/5] Fix BPF multi-uprobe PID filtering logic

Message ID 20240521163401.3005045-1-andrii@kernel.org (mailing list archive)
Headers show
Series Fix BPF multi-uprobe PID filtering logic | expand

Message

Andrii Nakryiko May 21, 2024, 4:33 p.m. UTC
It turns out that current implementation of multi-uprobe PID filtering logic
is broken. It filters by thread, while the promise is filtering by process.
Patch #1 fixes the logic trivially. The rest is testing and mitigations that
are necessary for libbpf to not break users of USDT programs.

v1->v2:
  - fix selftest in last patch (CI);
  - use semicolon in patch #3 (Jiri).

Andrii Nakryiko (5):
  bpf: fix multi-uprobe PID filtering logic
  bpf: remove unnecessary rcu_read_{lock,unlock}() in multi-uprobe
    attach logic
  libbpf: detect broken PID filtering logic for multi-uprobe
  selftests/bpf: extend multi-uprobe tests with child thread case
  selftests/bpf: extend multi-uprobe tests with USDTs

 kernel/trace/bpf_trace.c                      |  10 +-
 tools/lib/bpf/features.c                      |  31 +++-
 .../bpf/prog_tests/uprobe_multi_test.c        | 134 ++++++++++++++++--
 .../selftests/bpf/progs/uprobe_multi.c        |  50 ++++++-
 4 files changed, 206 insertions(+), 19 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org May 25, 2024, 5:50 p.m. UTC | #1
Hello:

This series was applied to bpf/bpf.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Tue, 21 May 2024 09:33:56 -0700 you wrote:
> It turns out that current implementation of multi-uprobe PID filtering logic
> is broken. It filters by thread, while the promise is filtering by process.
> Patch #1 fixes the logic trivially. The rest is testing and mitigations that
> are necessary for libbpf to not break users of USDT programs.
> 
> v1->v2:
>   - fix selftest in last patch (CI);
>   - use semicolon in patch #3 (Jiri).
> 
> [...]

Here is the summary with links:
  - [v2,bpf,1/5] bpf: fix multi-uprobe PID filtering logic
    https://git.kernel.org/bpf/bpf/c/46ba0e49b642
  - [v2,bpf,2/5] bpf: remove unnecessary rcu_read_{lock,unlock}() in multi-uprobe attach logic
    https://git.kernel.org/bpf/bpf/c/4a8f635a6054
  - [v2,bpf,3/5] libbpf: detect broken PID filtering logic for multi-uprobe
    https://git.kernel.org/bpf/bpf/c/04d939a2ab22
  - [v2,bpf,4/5] selftests/bpf: extend multi-uprobe tests with child thread case
    https://git.kernel.org/bpf/bpf/c/70342420a1cf
  - [v2,bpf,5/5] selftests/bpf: extend multi-uprobe tests with USDTs
    https://git.kernel.org/bpf/bpf/c/198034a87dfe

You are awesome, thank you!