[PATCHv3 bpf 0/4] bpf: Fix cookie values for kprobe multi

Jiri Olsa posted 4 patches 3 years, 10 months ago
kernel/trace/bpf_trace.c                                   | 60 +++++++++++++++++++++++++++++++++++++++++++++---------------
kernel/trace/ftrace.c                                      | 13 +++++++++++--
tools/testing/selftests/bpf/prog_tests/bpf_cookie.c        | 78 +++++++++++++++++++++++++++++++++++++++---------------------------------------
tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c |  3 +++
tools/testing/selftests/bpf/progs/kprobe_multi.c           | 24 ++++++++++++------------
5 files changed, 110 insertions(+), 68 deletions(-)
[PATCHv3 bpf 0/4] bpf: Fix cookie values for kprobe multi
Posted by Jiri Olsa 3 years, 10 months ago
hi,
there's bug in kprobe_multi link that makes cookies misplaced when
using symbols to attach. The reason is that we sort symbols by name
but not adjacent cookie values. Current test did not find it because
bpf_fentry_test* are already sorted by name.

v3 changes:
  - fixed kprobe_multi bench test to filter out invalid entries
    from available_filter_functions

v2 changes:
  - rebased on top of bpf/master
  - checking if cookies are defined later in swap function [Andrii]
  - added acks

thanks,
jirka


---
Jiri Olsa (4):
      selftests/bpf: Shuffle cookies symbols in kprobe multi test
      ftrace: Keep address offset in ftrace_lookup_symbols
      bpf: Force cookies array to follow symbols sorting
      selftest/bpf: Fix kprobe_multi bench test

 kernel/trace/bpf_trace.c                                   | 60 +++++++++++++++++++++++++++++++++++++++++++++---------------
 kernel/trace/ftrace.c                                      | 13 +++++++++++--
 tools/testing/selftests/bpf/prog_tests/bpf_cookie.c        | 78 +++++++++++++++++++++++++++++++++++++++---------------------------------------
 tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c |  3 +++
 tools/testing/selftests/bpf/progs/kprobe_multi.c           | 24 ++++++++++++------------
 5 files changed, 110 insertions(+), 68 deletions(-)
Re: [PATCHv3 bpf 0/4] bpf: Fix cookie values for kprobe multi
Posted by patchwork-bot+netdevbpf@kernel.org 3 years, 10 months ago
Hello:

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

On Wed, 15 Jun 2022 13:21:14 +0200 you wrote:
> hi,
> there's bug in kprobe_multi link that makes cookies misplaced when
> using symbols to attach. The reason is that we sort symbols by name
> but not adjacent cookie values. Current test did not find it because
> bpf_fentry_test* are already sorted by name.
> 
> v3 changes:
>   - fixed kprobe_multi bench test to filter out invalid entries
>     from available_filter_functions
> 
> [...]

Here is the summary with links:
  - [PATCHv3,bpf,1/4] selftests/bpf: Shuffle cookies symbols in kprobe multi test
    https://git.kernel.org/bpf/bpf/c/ad8848535e97
  - [PATCHv3,bpf,2/4] ftrace: Keep address offset in ftrace_lookup_symbols
    https://git.kernel.org/bpf/bpf/c/eb1b2985fe5c
  - [PATCHv3,bpf,3/4] bpf: Force cookies array to follow symbols sorting
    https://git.kernel.org/bpf/bpf/c/eb5fb0325698
  - [PATCHv3,bpf,4/4] selftest/bpf: Fix kprobe_multi bench test
    https://git.kernel.org/bpf/bpf/c/730067022c01

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html