From: Greg Kroah-Hartman Date: Tue, 18 Jun 2024 13:29:09 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v6.1.95~88 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=17462449354d6354ab0bd2ce9112d99b5c430734;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: tracing-selftests-fix-kprobe-event-name-test-for-.isra.-functions.patch --- diff --git a/queue-5.4/series b/queue-5.4/series index 670b6e4b94d..6971eeb925d 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -81,3 +81,4 @@ ionic-fix-use-after-netif_napi_del.patch drivers-core-synchronize-really_probe-and-dev_uevent.patch drm-exynos-vidi-fix-memory-leak-in-.get_modes.patch drm-exynos-hdmi-report-safe-640x480-mode-as-a-fallback-when-no-edid-found.patch +tracing-selftests-fix-kprobe-event-name-test-for-.isra.-functions.patch diff --git a/queue-5.4/tracing-selftests-fix-kprobe-event-name-test-for-.isra.-functions.patch b/queue-5.4/tracing-selftests-fix-kprobe-event-name-test-for-.isra.-functions.patch new file mode 100644 index 00000000000..9cb60fe6ef3 --- /dev/null +++ b/queue-5.4/tracing-selftests-fix-kprobe-event-name-test-for-.isra.-functions.patch @@ -0,0 +1,50 @@ +From 23a4b108accc29a6125ed14de4a044689ffeda78 Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (Google)" +Date: Mon, 20 May 2024 20:57:37 -0400 +Subject: tracing/selftests: Fix kprobe event name test for .isra. functions + +From: Steven Rostedt (Google) + +commit 23a4b108accc29a6125ed14de4a044689ffeda78 upstream. + +The kprobe_eventname.tc test checks if a function with .isra. can have a +kprobe attached to it. It loops through the kallsyms file for all the +functions that have the .isra. name, and checks if it exists in the +available_filter_functions file, and if it does, it uses it to attach a +kprobe to it. + +The issue is that kprobes can not attach to functions that are listed more +than once in available_filter_functions. With the latest kernel, the +function that is found is: rapl_event_update.isra.0 + + # grep rapl_event_update.isra.0 /sys/kernel/tracing/available_filter_functions + rapl_event_update.isra.0 + rapl_event_update.isra.0 + +It is listed twice. This causes the attached kprobe to it to fail which in +turn fails the test. Instead of just picking the function function that is +found in available_filter_functions, pick the first one that is listed +only once in available_filter_functions. + +Cc: stable@vger.kernel.org +Fixes: 604e3548236d ("selftests/ftrace: Select an existing function in kprobe_eventname test") +Signed-off-by: Steven Rostedt (Google) +Acked-by: Masami Hiramatsu (Google) +Signed-off-by: Shuah Khan +Signed-off-by: Greg Kroah-Hartman +--- + tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc ++++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc +@@ -31,7 +31,8 @@ find_dot_func() { + fi + + grep " [tT] .*\.isra\..*" /proc/kallsyms | cut -f 3 -d " " | while read f; do +- if grep -s $f available_filter_functions; then ++ cnt=`grep -s $f available_filter_functions | wc -l`; ++ if [ $cnt -eq 1 ]; then + echo $f + break + fi