]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Sep 2021 06:11:29 +0000 (08:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Sep 2021 06:11:29 +0000 (08:11 +0200)
added patches:
tracing-kprobe-fix-kprobe_on_func_entry-modification.patch

queue-4.19/series
queue-4.19/tracing-kprobe-fix-kprobe_on_func_entry-modification.patch [new file with mode: 0644]

index a9b3924a26bbe8a8857945402704312da41d4eb7..b3e6055b938afbe93301085911e7fa8dbd26e393 100644 (file)
@@ -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 (file)
index 0000000..07f4a3a
--- /dev/null
@@ -0,0 +1,37 @@
+From lihuafei1@huawei.com  Fri Sep 24 08:10:49 2021
+From: Li Huafei <lihuafei1@huawei.com>
+Date: Fri, 24 Sep 2021 10:54:48 +0800
+Subject: tracing/kprobe: Fix kprobe_on_func_entry() modification
+To: <gregkh@linuxfoundation.org>
+Cc: <mhiramat@kernel.org>, <rostedt@goodmis.org>, <mingo@redhat.com>, <linux-kernel@vger.kernel.org>
+Message-ID: <20210924025448.232959-1-lihuafei1@huawei.com>
+
+From: Li Huafei <lihuafei1@huawei.com>
+
+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 <lihuafei1@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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;
+               }