Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6cfbbb96 authored by Li Huafei's avatar Li Huafei Committed by Greg Kroah-Hartman
Browse files

tracing/kprobe: Fix kprobe_on_func_entry() modification



The commit 960434ac ("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: 960434ac ("tracing/kprobe: Fix to support kretprobe events on unloaded modules")
Signed-off-by: default avatarLi Huafei <lihuafei1@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 320dc471
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -836,8 +836,9 @@ static int create_trace_kprobe(int argc, char **argv)
			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;
		}