Skip to content

Return EADDRNOTAVAIL when func matches several symbols during kprobe creation

Francis Laniel stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbolskernel/trace/trace_kprobe.c+48 -00 replies

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchMasami Hiramatsu (Google)
1/1A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 4.14.y 0/1] Return EADDRNOTAVAIL when func matches several symbols during kprobe creation

Hi.

I received messages regarding problems to apply the upstream patch. I was able to reproduce the problem on the following stable kernels:
* 4.14,
* 4.19,
* 5.4
* and 5.10
But it seems to be false positive for kernel 5.15 and 6.1, is this case possible or I did something wrong?

For kernel 4.14, I adapted the patch and tested it to confirm its behavior:

root@vm-amd64:~# uname -a
Linux vm-amd64 4.14.327+ #120 SMP Mon Oct 23 12:26:47 EEST 2023 x86_64 GNU/Linux
root@vm-amd64:~# echo 'p:probe/name_show name_show' > /sys/kernel/tracing/kprobe_events
-bash: echo: write error: Cannot assign requested address

I would nonetheless like to get reviews before having it merged as it is a bit different from upstream patch.
In the meanwhile, I will work on applying this patch to other kernels. The goal would be to have two versions of the patch:
1. One for "older" kernels (i.e before 5.15).
2. Another for "younger" kernels (i.e. 5.15 and above).
I am not really sure if this is way to work with stable kernels, as this is first time I have to deal with such a case.
So, any feedback on how to handle it properly would be more than welcome.

Francis Laniel (1):
tracing/kprobes: Return EADDRNOTAVAIL when func matches several
symbols

 kernel/trace/trace_kprobe.c | 48 +++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

Best regards and thank you in advance.
--
2.34.1