From: Greg Kroah-Hartman Date: Fri, 24 Sep 2021 06:11:29 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v4.4.285~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=49ce9a3ba1699ebe6e2e8f585846d240816b6576;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: tracing-kprobe-fix-kprobe_on_func_entry-modification.patch --- diff --git a/queue-4.19/series b/queue-4.19/series index a9b3924a26b..b3e6055b938 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -7,3 +7,4 @@ arm-9077-1-plt-move-struct-plt_entries-definition-to-header.patch arm-9078-1-add-warn-suppress-parameter-to-arm_gen_branch_link.patch arm-9079-1-ftrace-add-module_plts-support.patch arm-9098-1-ftrace-module_plt-fix-build-problem-without-dynamic_ftrace.patch +tracing-kprobe-fix-kprobe_on_func_entry-modification.patch diff --git a/queue-4.19/tracing-kprobe-fix-kprobe_on_func_entry-modification.patch b/queue-4.19/tracing-kprobe-fix-kprobe_on_func_entry-modification.patch new file mode 100644 index 00000000000..07f4a3ac827 --- /dev/null +++ b/queue-4.19/tracing-kprobe-fix-kprobe_on_func_entry-modification.patch @@ -0,0 +1,37 @@ +From lihuafei1@huawei.com Fri Sep 24 08:10:49 2021 +From: Li Huafei +Date: Fri, 24 Sep 2021 10:54:48 +0800 +Subject: tracing/kprobe: Fix kprobe_on_func_entry() modification +To: +Cc: , , , +Message-ID: <20210924025448.232959-1-lihuafei1@huawei.com> + +From: Li Huafei + +The commit 960434acef37 ("tracing/kprobe: Fix to support kretprobe +events on unloaded modules") backport from v5.11, which modifies the +return value of kprobe_on_func_entry(). However, there is no adaptation +modification in create_trace_kprobe(), resulting in the exact opposite +behavior. Now we need to return an error immediately only if +kprobe_on_func_entry() returns -EINVAL. + +Fixes: 960434acef37 ("tracing/kprobe: Fix to support kretprobe events on unloaded modules") +Signed-off-by: Li Huafei +Signed-off-by: Greg Kroah-Hartman +--- + kernel/trace/trace_kprobe.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/kernel/trace/trace_kprobe.c ++++ b/kernel/trace/trace_kprobe.c +@@ -836,8 +836,9 @@ static int create_trace_kprobe(int argc, + pr_info("Failed to parse either an address or a symbol.\n"); + return ret; + } ++ /* Defer the ENOENT case until register kprobe */ + if (offset && is_return && +- !kprobe_on_func_entry(NULL, symbol, offset)) { ++ kprobe_on_func_entry(NULL, symbol, offset) == -EINVAL) { + pr_info("Given offset is not valid for return probe.\n"); + return -EINVAL; + }