From: Francis Laniel <flaniel@linux.microsoft.com>
To: stable@vger.kernel.org
Cc: Greg KH <gregkh@linuxfoundation.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Francis Laniel <flaniel@linux.microsoft.com>
Subject: [PATCH 5.15.y v1 0/2] Return EADDRNOTAVAIL when func matches several symbols during kprobe creation
Date: Fri, 1 Dec 2023 16:19:55 +0100 [thread overview]
Message-ID: <20231201151957.682381-1-flaniel@linux.microsoft.com> (raw)
Hi!
The second patch of this series caused some troubles on 5.15.y, I apologize
about it [1].
When I tested it locally, I needed to set CONFIG_LIVEPATCH, so
kallsyms_on_each_symbol() would be known at link time.
To cope with this problem, we need to backport the first patch of this series as
pointed by Guenter Roeck [2].
This patch is only needed for 5.15, indeed the dependencies on CONFIG_LIVEPATCH
for kallsyms_on_each_symbol() was added in 3e3552056ab4
("kallsyms: only build {,module_}kallsyms_on_each_symbol when required").
This commit was first added to kernel 5.12, as git indicates it:
$ git name-rev --tags --name-only 3e3552056ab4
v5.12-rc1~67^2~8
Moreover, the first patch of this series, i.e. d721def7392a
("kallsyms: Make kallsyms_on_each_symbol generally available") was first added
in:
$ git name-rev --tags --name-only d721def7392a
v5.19-rc1~159^2~4^2~38^2~4
So, my patch only needs the first patch for the 5.15 kernel.
Regarding these two patches, I built and tested the series for several
architectures:
* i386:
$ make ARCH=i386 defconfig kvm_guest.config
...
$ make ARCH=i386 -j$(nproc)
...
Kernel: arch/x86/boot/bzImage is ready (#1)
$ bash run_extern_kernel.sh i386
...
root@vm-i386:~# uname -mr
5.15.140+ i686
root@vm-i386:~# echo 'p:myprobe name_show' > /sys/kernel/tracing/kprobe_events
-bash: echo: write error: Cannot assign requested address
* x86_64:
$ make x86_64_defconfig kvm_guest.config
...
$ make -j$(nproc)
...
Kernel: arch/x86/boot/bzImage is ready (#9)
$ bash run_extern_kernel.sh
...
root@vm-amd64:~# uname -rm
5.15.140+ x86_64
root@vm-amd64:~# echo 'p:myprobe name_show' > /sys/kernel/tracing/kprobe_events
-bash: echo: write error: Cannot assign requested address
* arm:
$ make ARCH=arm defconfig kvm_guest.config
...
$ make ARCH=arm menuconfig
# Add CONFIG_KPROBES
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j$(nproc)
...
Kernel: arch/arm/boot/zImage is ready
$ bash run_extern_kernel.sh armel
...
root@vm-armel:~# uname -mr
5.15.140-00002-gd3fdc3ca50b5 armv7l
root@vm-armel:~# echo 'p:myprobe name_show' > /sys/kernel/tracing/kprobe_events
-bash: echo: write error: Cannot assign requested address
* arm64:
$ make ARCH=arm64 defconfig kvm_guest.config
# Add CONFIG_KPROBES
...
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j$(nproc)
...
OBJCOPY arch/arm64/boot/Image
GZIP arch/arm64/boot/Image.gz
$ bash run_extern_kernel.sh arm64
...
root@vm-arm64:~# uname -mr
5.15.140-00002-gd3fdc3ca50b5 aarch64
root@vm-arm64:~# echo 'p:myprobe name_show' > /sys/kernel/tracing/kprobe_events
-bash: echo: write error: Cannot assign requested address
If you see any ways to improve this patch, please share your feedback.
Francis Laniel (1):
tracing/kprobes: Return EADDRNOTAVAIL when func matches several
symbols
Jiri Olsa (1):
kallsyms: Make kallsyms_on_each_symbol generally available
include/linux/kallsyms.h | 7 +++-
kernel/kallsyms.c | 2 -
kernel/trace/trace_kprobe.c | 74 +++++++++++++++++++++++++++++++++++++
kernel/trace/trace_probe.h | 1 +
4 files changed, 81 insertions(+), 3 deletions(-)
Best regards.
---
[1]: https://lore.kernel.org/stable/CAEUSe78tYPTFuauB7cxZzvAeMhzB_25Q8DqLUfF7Nro9WsUhNw@mail.gmail.com/
[2]: https://lore.kernel.org/stable/06deae26-c59c-4746-867d-ab6f5852b0af@roeck-us.net/
--
2.34.1
next reply other threads:[~2023-12-01 15:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-01 15:19 Francis Laniel [this message]
2023-12-01 15:19 ` [PATCH 5.15.y v1 1/2] kallsyms: Make kallsyms_on_each_symbol generally available Francis Laniel
2023-12-01 23:02 ` Greg KH
2023-12-04 8:19 ` Francis Laniel
2023-12-04 23:58 ` Greg KH
2023-12-05 9:42 ` Francis Laniel
2023-12-01 15:19 ` [PATCH 5.15.y v1 2/2] tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols Francis Laniel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231201151957.682381-1-flaniel@linux.microsoft.com \
--to=flaniel@linux.microsoft.com \
--cc=gregkh@linuxfoundation.org \
--cc=mhiramat@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox