From 90d759d2a7a67c0872877d55860bf8350e78fb77 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 28 Jun 2022 04:29:35 -0400 Subject: [PATCH] import systemtap-4.6-13.el9_0 --- SOURCES/rhbz2083727.patch | 38 ++++++++++++++++++++++++++++++++++++++ SPECS/systemtap.spec | 7 ++++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 SOURCES/rhbz2083727.patch diff --git a/SOURCES/rhbz2083727.patch b/SOURCES/rhbz2083727.patch new file mode 100644 index 0000000..cc60a15 --- /dev/null +++ b/SOURCES/rhbz2083727.patch @@ -0,0 +1,38 @@ +commit 9b6f4d4e4f2649b05459be4ecf48a42661163fd1 +Author: Stan Cox +Date: Fri Feb 25 14:09:26 2022 -0500 + + PR28557: module probe insertion on modern kernels + + Similar to commit 0425c60d7 but for return probes. Try to fully relocate + addresses, before letting the kernel try it with symbols / kallsyms. + +diff --git a/runtime/linux/kprobes.c b/runtime/linux/kprobes.c +index d59935d06..09f0e0665 100644 +--- a/runtime/linux/kprobes.c ++++ b/runtime/linux/kprobes.c +@@ -269,15 +269,17 @@ stapkp_prepare_kretprobe(struct stap_kprobe_probe *skp) + struct kretprobe *krp = &skp->kprobe->u.krp; + unsigned long addr = 0; + +- if (! skp->symbol_name) { +- addr = stapkp_relocate_addr(skp); +- if (addr == 0) +- return 1; +- krp->kp.addr = (void *) addr; ++ // PR28557 Try a pass resolving the address now with the currently ++ // known module/section addresses within our own stap-symbols tables. ++ addr = stapkp_relocate_addr(skp); ++ if (addr != 0) { ++ krp->kp.addr = (void*) addr; + } +- else { ++ // fall back to kallsyms-based or kernel kprobes-delegated symbolic ++ // registration ++ else if (skp->symbol_name) { + if (USE_KALLSYMS_ON_EACH_SYMBOL && krp->kp.addr == 0) +- return 1; ++ return 4; + else if (!USE_KALLSYMS_ON_EACH_SYMBOL) { + #if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) + if (krp->kp.symbol_name == NULL) diff --git a/SPECS/systemtap.spec b/SPECS/systemtap.spec index ac916a1..de025df 100644 --- a/SPECS/systemtap.spec +++ b/SPECS/systemtap.spec @@ -118,7 +118,7 @@ m stapdev stapdev Name: systemtap Version: 4.6 -Release: 12%{?release_override}%{?dist} +Release: 13%{?release_override}%{?dist} # for version, see also configure.ac @@ -162,6 +162,7 @@ Patch5: rhbz2027683.patch Patch6: rhbz2047256.patch Patch7: rhbz2039207.patch Patch8: rhbz2058908.patch +Patch9: rhbz2083727.patch # Build* BuildRequires: make @@ -591,6 +592,7 @@ systemtap-runtime-virthost machine to execute systemtap scripts. %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 %build @@ -1287,6 +1289,9 @@ exit 0 # PRERELEASE %changelog +* Thu May 12 2022 Frank Ch. Eigler - 4.6-13 +- rhbz2083727: fix kernel module .return probes + * Fri Mar 11 2022 Frank Ch. Eigler - 4.6-12 - rhbz2058908: Change sys/sdt.h on x86-64 to stop allowing xmm registers