]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tracing/kprobes: Skip symbol counting logic for module symbols in create_local_trace_...
authorNikolay Kuratov <kniv@yandex-team.ru>
Mon, 16 Dec 2024 11:19:23 +0000 (14:19 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Dec 2024 17:06:12 +0000 (18:06 +0100)
commit b022f0c7e404 ("tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols")
avoids checking number_of_same_symbols() for module symbol in
__trace_kprobe_create(), but create_local_trace_kprobe() should avoid this
check too. Doing this check leads to ENOENT for module_name:symbol_name
constructions passed over perf_event_open.

No bug in newer kernels as it was fixed more generally by
commit 9d8616034f16 ("tracing/kprobes: Add symbol counting check when module loads")

Link: https://lore.kernel.org/linux-trace-kernel/20240705161030.b3ddb33a8167013b9b1da202@kernel.org
Fixes: b022f0c7e404 ("tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols")
Signed-off-by: Nikolay Kuratov <kniv@yandex-team.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/trace_kprobe.c

index ae059345ddf4c29b7441f4304025b1a4325e0da3..164779c6d1333b9f5432f47258b875796918a98b 100644 (file)
@@ -1872,7 +1872,7 @@ create_local_trace_kprobe(char *func, void *addr, unsigned long offs,
        int ret;
        char *event;
 
-       if (func) {
+       if (func && !strchr(func, ':')) {
                unsigned int count;
 
                count = number_of_same_symbols(func);