diff --git a/SOURCES/rhbz1808185.patch b/SOURCES/rhbz1808185.patch new file mode 100644 index 0000000..d0ec4c0 --- /dev/null +++ b/SOURCES/rhbz1808185.patch @@ -0,0 +1,94 @@ +commit 2303f9f86576fe74790b545bee81960bc73f599c +Author: Frank Ch. Eigler +Date: Tue Feb 18 16:45:04 2020 -0500 + + PR11249 etc.: tweak userspace function blacklist + + Add some uretprobes blacklist entries for 32-on-64 function + __x86.get_pc_thunk.bx and its kin. Some bug between the kernel + uretprobes implementation and the systemtap runtime causes a SEGV on + the target process if a uretprobe is hit there. Add retblacklist.exp + to test. + +diff --git a/dwflpp.cxx b/dwflpp.cxx +index c3f1c16..83a06d5 100644 +--- a/dwflpp.cxx ++++ b/dwflpp.cxx +@@ -4577,11 +4577,13 @@ dwflpp::build_user_blacklist() + + // Non-matching placeholders until we have real things to match + blfn += ".^"; ++ blfn_ret += ".^"; + blfile += ".^"; + blsection += ".^"; + + // These functions don't use the normal function-entry ABI, so can't be .return probed safely +- blfn_ret += "_start"; ++ blfn_ret += "|_start"; ++ blfn_ret += "|__.*\\.get_pc_thunk\\..*"; // PR11249 etc. + + blfn += ")$"; + blfn_ret += ")$"; +diff --git a/testsuite/systemtap.base/retblacklist.c b/testsuite/systemtap.base/retblacklist.c +new file mode 100644 +index 0000000..9d1ecdf +--- /dev/null ++++ b/testsuite/systemtap.base/retblacklist.c +@@ -0,0 +1,10 @@ ++int f(int x) ++{ ++ return 0; ++} ++ ++int main() ++{ ++ f(128); ++ return 0; ++} +diff --git a/testsuite/systemtap.base/retblacklist.exp b/testsuite/systemtap.base/retblacklist.exp +new file mode 100644 +index 0000000..3b90cae +--- /dev/null ++++ b/testsuite/systemtap.base/retblacklist.exp +@@ -0,0 +1,32 @@ ++set test "retblacklist" ++ ++set res [target_compile $srcdir/$subdir/$test.c $test.exe executable "-g"] ++if { $res != "" } { ++ verbose "target_compile $test failed: $res" 2 ++ fail "$test.c compile" ++ untested "$test" ++ return ++} else { ++ pass "$test.c compile" ++} ++ ++ ++if {! [installtest_p]} { ++ untested "#test" ++ return ++} ++ ++set ko 0 ++spawn stap -w $srcdir/$subdir/$test.stp -c ./$test.exe ++expect { ++ -timeout 20 ++ "_start" { incr ko; exp_continue } ++ "get_pc_thunk" { incr ko; exp_continue } ++ eof { } ++} ++verbose -log "ko=$ko" ++ ++if {$ko == 0} then { pass $test } else { fail $test } ++ ++catch {exec rm -f $test.exe} ++ +diff --git a/testsuite/systemtap.base/retblacklist.stp b/testsuite/systemtap.base/retblacklist.stp +new file mode 100644 +index 0000000..5a2cb3a +--- /dev/null ++++ b/testsuite/systemtap.base/retblacklist.stp +@@ -0,0 +1,3 @@ ++probe process.function("*").return { ++ println(ppfunc(),(@entry($$vars) != "" ? " ok" : " ko")) ++} diff --git a/SOURCES/rhbz1810216.patch b/SOURCES/rhbz1810216.patch new file mode 100644 index 0000000..8f9fab5 --- /dev/null +++ b/SOURCES/rhbz1810216.patch @@ -0,0 +1,63 @@ +commit ffb40c659a690f4341e43051f6d5114732b3fe46 +Author: Frank Ch. Eigler +Date: Thu Mar 5 07:17:04 2020 -0500 + + RHBZ1810216: fix ftrace() tapset function related autoconf test + + It was reported that the ftrace() tapset function stopped working at + some point - due to an autoconf-* false negative. We failed to notice + because the tapset function was quietly mapped to a nop in this case. + Now ftrace() will #error in -p4 if autoconf doesn't detect a suitable + kernel facility. A forked testcase buildok/logging-embedded2.stp + checks for it. + + Suggested-by: Oleksandr Natalenko + +diff --git a/runtime/linux/autoconf-trace-printk.c b/runtime/linux/autoconf-trace-printk.c +index 8330a58..c7515bc 100644 +--- a/runtime/linux/autoconf-trace-printk.c ++++ b/runtime/linux/autoconf-trace-printk.c +@@ -1,4 +1,5 @@ + #include ++#include + + int bar (void) { + static char *fmt = "%s\n"; +diff --git a/tapset/linux/logging.stp b/tapset/linux/logging.stp +index 6192cf6..b13b5cc 100644 +--- a/tapset/linux/logging.stp ++++ b/tapset/linux/logging.stp +@@ -25,6 +25,8 @@ function ftrace (msg:string) %{ /* unmodified-fnargs */ + to defeat trace_printk -> __trace_bprintk optimization. That's + because bprintk doesn't save the incoming strings, only their + addresses. */ ++#else ++ #error "trace_printk not supported" + #endif + %} + +diff --git a/testsuite/buildok/logging-embedded.stp b/testsuite/buildok/logging-embedded.stp +index c97bd5a..7e2f15d 100755 +--- a/testsuite/buildok/logging-embedded.stp ++++ b/testsuite/buildok/logging-embedded.stp +@@ -8,6 +8,6 @@ probe begin { + exit() + error("error") + stp_print_binary(1, 0, 0, 0, 0) +- ftrace("ftrace") ++ // ftrace() tested in logging-embedded2.stp + printk(0,"Zoink! The paper tape punch is burning chads!") + } +diff --git a/testsuite/buildok/logging-embedded2.stp b/testsuite/buildok/logging-embedded2.stp +new file mode 100755 +index 0000000..528d5d0 +--- /dev/null ++++ b/testsuite/buildok/logging-embedded2.stp +@@ -0,0 +1,7 @@ ++#! stap -gp4 ++ ++// build-test the logging tapset functions - ftrace() only usable if STAPCONF detects it ++ ++probe begin { ++ ftrace("ftrace") ++} diff --git a/SPECS/systemtap.spec b/SPECS/systemtap.spec index 0ac3ec1..8d44122 100644 --- a/SPECS/systemtap.spec +++ b/SPECS/systemtap.spec @@ -88,7 +88,7 @@ Name: systemtap Version: 4.0 -Release: 11%{?release_override}%{?dist} +Release: 13%{?release_override}%{?dist} # for version, see also configure.ac @@ -165,6 +165,8 @@ Patch37: rhbz1657909.patch Patch50: bpf-unwarn.patch Patch51: stapbpf-kmsg.patch Patch52: rhbz1731333.patch +Patch60: rhbz1808185.patch +Patch61: rhbz1810216.patch # Build* BuildRequires: gcc-c++ @@ -618,6 +620,8 @@ cd .. %patch50 -p1 %patch51 -p1 %patch52 -p1 +%patch60 -p1 +%patch61 -p1 %build @@ -1361,6 +1365,12 @@ done # PRERELEASE %changelog +* Tue Mar 17 2020 Frank Ch. Eigler - 4.0-13 +- rhbz1810216: fix ftrace tapset (autoconf) + +* Tue Mar 03 2020 Frank Ch. Eigler - 4.0-12 +- rhbz1808185: uretprobe blacklist for get_pc_thunk intrinsics + * Wed Oct 16 2019 Frank Ch. Eigler - 4.0-11 - dummy respin to bump NVR relative to 7.7.z build