Andrii Nakryiko
f198659ecb
tracing/kprobes: Fix symbol counting logic by looking at modules as well
...
commit 926fe783c8a64b33997fec405cf1af3e61aed441 upstream.
Recent changes to count number of matching symbols when creating
a kprobe event failed to take into account kernel modules. As such, it
breaks kprobes on kernel module symbols, by assuming there is no match.
Fix this my calling module_kallsyms_on_each_symbol() in addition to
kallsyms_on_each_match_symbol() to perform a proper counting.
Link: https://lore.kernel.org/all/20231027233126.2073148-1-andrii@kernel.org/
Cc: Francis Laniel <flaniel@linux.microsoft.com>
Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Fixes: b022f0c7e404 ("tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Song Liu <song@kernel.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
[ Sherry: It's a fix for previous backport, thus backport together to 5.4.y ]
Signed-off-by: Sherry Yang <sherry.yang@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-08 16:20:47 +01:00
..
bpf
bpf: Check percpu map value size first
2024-11-08 16:20:44 +01:00
cgroup
cgroup: Protect css->cgroup write under css_set_lock
2024-09-12 11:03:53 +02:00
configs
debug
kdb: Use the passed prompt in kdb_position_cursor()
2024-08-19 05:33:40 +02:00
dma
dma: fix call order in dmam_free_coherent
2024-08-19 05:33:41 +02:00
events
uprobes: fix kernel info leak via "[uprobes]" vma
2024-11-08 16:20:42 +01:00
gcov
gcov: add support for GCC 14
2024-07-05 09:08:24 +02:00
irq
genirq/irqdesc: Honor caller provided affinity in alloc_desc()
2024-08-19 05:33:52 +02:00
livepatch
livepatch: fix race between fork and KLP transition
2022-10-26 13:22:18 +02:00
locking
lockdep: fix deadlock issue between lockdep and rcu
2024-11-08 16:20:46 +01:00
power
PM: suspend: Set mem_sleep_current during kernel command line setup
2024-04-13 12:51:24 +02:00
printk
printk: Update @console_may_schedule in console_trylock_spinning()
2024-04-13 12:51:29 +02:00
rcu
rcutorture: Fix rcu_torture_one_read() pipe_count overflow comment
2024-07-05 09:08:20 +02:00
sched
sched/fair: Allow disabling sched_balance_newidle with sched_relax_domain_level
2024-06-16 13:28:41 +02:00
time
posix-clock: Fix missing timespec64 check in pc_clock_settime()
2024-11-08 16:20:47 +01:00
trace
tracing/kprobes: Fix symbol counting logic by looking at modules as well
2024-11-08 16:20:47 +01:00
.gitignore
acct.c
acct: fix potential integer overflow in encode_comp_t()
2023-01-18 11:41:34 +01:00
async.c
treewide: Remove uninitialized_var() usage
2023-06-09 10:29:01 +02:00
audit.c
audit: Send netlink ACK before setting connection in auditd_set
2024-02-23 08:24:54 +01:00
audit.h
audit_fsnotify.c
audit: fix potential double free on error path from fsnotify_add_inode_mark
2022-09-05 10:27:38 +02:00
audit_tree.c
audit_watch.c
audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare()
2023-11-28 16:50:18 +00:00
auditfilter.c
auditsc.c
audit: fix possible soft lockup in __audit_inode_child()
2023-09-23 10:59:46 +02:00
backtracetest.c
treewide: Replace DECLARE_TASKLET() with DECLARE_TASKLET_OLD()
2023-04-20 12:07:32 +02:00
bounds.c
bounds: Use the right number of bits for power-of-two CONFIG_NR_CPUS
2024-05-02 16:18:37 +02:00
capability.c
compat.c
sched_getaffinity: don't assume 'cpumask_size()' is fully initialized
2023-04-05 11:16:42 +02:00
configs.c
context_tracking.c
cpu.c
hrtimers: Push pending hrtimers away from outgoing CPU earlier
2023-12-13 18:18:09 +01:00
cpu_pm.c
crash_core.c
crash_dump.c
cred.c
cred: switch to using atomic_long_t
2023-12-20 15:41:18 +01:00
delayacct.c
dma.c
exec_domain.c
exit.c
mm: optimize the redundant loop of mm_update_owner_next()
2024-07-18 11:40:51 +02:00
extable.c
kernel/extable.c: use address-of operator on section symbols
2023-06-09 10:29:01 +02:00
fail_function.c
kernel/fail_function: fix memory leak with using debugfs_lookup()
2023-03-11 16:44:15 +01:00
fork.c
kernel/fork: beware of __put_task_struct() calling context
2023-09-23 11:00:03 +02:00
freezer.c
futex.c
treewide: Remove uninitialized_var() usage
2023-06-09 10:29:01 +02:00
gen_kheaders.sh
kheaders: explicitly define file modes for archived headers
2024-07-05 09:08:25 +02:00
groups.c
hung_task.c
iomem.c
irq_work.c
jump_label.c
kallsyms.c
kcmp.c
Kconfig.freezer
Kconfig.hz
Kconfig.locks
Kconfig.preempt
kcov.c
kexec.c
kexec_core.c
kexec: fix a memory leak in crash_shrink_memory()
2023-07-27 08:37:10 +02:00
kexec_elf.c
kexec_file.c
kexec: support purgatories with .text.hot sections
2023-06-21 15:44:10 +02:00
kexec_internal.h
kheaders.c
kheaders: Use array declaration instead of char
2023-05-17 11:35:33 +02:00
kmod.c
kprobes.c
kprobes: Fix possible use-after-free issue on kprobe registration
2024-05-02 16:18:30 +02:00
ksysfs.c
kthread.c
kthread: fix task state in kthread worker if being frozen
2024-11-08 16:20:30 +01:00
latencytop.c
Makefile
module-internal.h
module.c
modules: only allow symbol_get of EXPORT_SYMBOL_GPL modules
2023-09-23 10:59:36 +02:00
module_signature.c
module_signing.c
notifier.c
nsproxy.c
padata.c
crypto: pcrypt - Fix hungtask for PADATA_RESET
2023-11-28 16:50:14 +00:00
panic.c
panic: Flush kernel log buffer at the end
2024-04-13 12:51:37 +02:00
params.c
params: lift param_set_uint_minmax to common code
2024-06-16 13:28:45 +02:00
pid.c
pid_namespace.c
profile.c
profiling: fix shift too large makes kernel panic
2022-08-25 11:18:02 +02:00
ptrace.c
range.c
reboot.c
kernel/reboot: emergency_restart: Set correct system_state
2023-11-28 16:50:19 +00:00
relay.c
relayfs: fix out-of-bounds access in relay_file_read
2023-05-17 11:35:58 +02:00
resource.c
resource: fix region_intersects() vs add_memory_driver_managed()
2024-11-08 16:20:46 +01:00
rseq.c
seccomp.c
signal.c
signal: Replace BUG_ON()s
2024-11-08 16:20:38 +01:00
smp.c
smp: Add missing destroy_work_on_stack() call in smp_call_on_cpu()
2024-09-12 11:03:54 +02:00
smpboot.c
smpboot.h
softirq.c
stackleak.c
stacktrace.c
stop_machine.c
sys.c
getrusage: use sig->stats_lock rather than lock_task_sighand()
2024-03-15 10:48:19 -04:00
sys_ni.c
kernel/sys_ni: add compat entry for fadvise64_64
2022-09-05 10:27:38 +02:00
sysctl-test.c
sysctl.c
sched/rt: Disallow writing invalid values to sched_rt_period_us
2024-03-01 13:13:33 +01:00
sysctl_binary.c
task_work.c
taskstats.c
test_kprobes.c
torture.c
tracepoint.c
tsacct.c
ucount.c
uid16.c
uid16.h
umh.c
up.c
user-return-notifier.c
user.c
user_namespace.c
utsname.c
utsname_sysctl.c
watchdog.c
watchdog: export lockup_detector_reconfigure
2022-08-25 11:18:37 +02:00
watchdog_hld.c
watchdog/perf: properly initialize the turbo mode timestamp and rearm counter
2024-08-19 05:33:39 +02:00
workqueue.c
workqueue: Override implicit ordered attribute in workqueue_apply_unbound_cpumask()
2023-10-25 11:53:18 +02:00
workqueue_internal.h