Patch "tracing/kprobe: Fix kprobe_on_func_entry() modification" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    tracing/kprobe: Fix kprobe_on_func_entry() modification

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tracing-kprobe-fix-kprobe_on_func_entry-modification.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From lihuafei1@xxxxxxxxxx  Fri Sep 24 08:10:49 2021
From: Li Huafei <lihuafei1@xxxxxxxxxx>
Date: Fri, 24 Sep 2021 10:54:48 +0800
Subject: tracing/kprobe: Fix kprobe_on_func_entry() modification
To: <gregkh@xxxxxxxxxxxxxxxxxxx>
Cc: <mhiramat@xxxxxxxxxx>, <rostedt@xxxxxxxxxxx>, <mingo@xxxxxxxxxx>, <linux-kernel@xxxxxxxxxxxxxxx>
Message-ID: <20210924025448.232959-1-lihuafei1@xxxxxxxxxx>

From: Li Huafei <lihuafei1@xxxxxxxxxx>

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@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 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;
 		}


Patches currently in stable-queue which might be from lihuafei1@xxxxxxxxxx are

queue-4.19/tracing-kprobe-fix-kprobe_on_func_entry-modification.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux