Menglong Dong
ceb5d8d367
tracing: fprobe: fix suspicious rcu usage in fprobe_entry
rcu_read_lock() is not needed in fprobe_entry, but rcu_dereference_check()
is used in rhltable_lookup(), which causes suspicious RCU usage warning:
WARNING: suspicious RCU usage
6.17.0-rc1-00001-gdfe0d675df82 #1 Tainted: G S
-----------------------------
include/linux/rhashtable.h:602 suspicious rcu_dereference_check() usage!
......
stack backtrace:
CPU: 1 UID: 0 PID: 4652 Comm: ftracetest Tainted: G S
Tainted: [S]=CPU_OUT_OF_SPEC, [I]=FIRMWARE_WORKAROUND
Hardware name: Dell Inc. OptiPlex 7040/0Y7WYT, BIOS 1.1.1 10/07/2015
Call Trace:
<TASK>
dump_stack_lvl+0x7c/0x90
lockdep_rcu_suspicious+0x14f/0x1c0
__rhashtable_lookup+0x1e0/0x260
? __pfx_kernel_clone+0x10/0x10
fprobe_entry+0x9a/0x450
? __lock_acquire+0x6b0/0xca0
? find_held_lock+0x2b/0x80
? __pfx_fprobe_entry+0x10/0x10
? __pfx_kernel_clone+0x10/0x10
? lock_acquire+0x14c/0x2d0
? __might_fault+0x74/0xc0
function_graph_enter_regs+0x2a0/0x550
? __do_sys_clone+0xb5/0x100
? __pfx_function_graph_enter_regs+0x10/0x10
? _copy_to_user+0x58/0x70
? __pfx_kernel_clone+0x10/0x10
? __x64_sys_rt_sigprocmask+0x114/0x180
? __pfx___x64_sys_rt_sigprocmask+0x10/0x10
? __pfx_kernel_clone+0x10/0x10
ftrace_graph_func+0x87/0xb0
As we discussed in [1], fix this by using guard(rcu)() in fprobe_entry()
to protect the rhltable_lookup() and rhl_for_each_entry_rcu() with
rcu_read_lock and suppress this warning.
Link: https://lore.kernel.org/all/20250904062729.151931-1-dongml2@chinatelecom.cn/
Link: https://lore.kernel.org/all/20250829021436.19982-1-dongml2@chinatelecom.cn/ [1]
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202508281655.54c87330-lkp@intel.com
Fixes: dfe0d675df82 ("tracing: fprobe: use rhltable for fprobe_ip_table")
Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
2025-11-01 01:10:29 +09:00
..
2025-10-16 10:45:17 -07:00
2025-10-20 09:41:27 -10:00
2025-09-24 14:29:14 -07:00
2025-09-20 21:19:09 +01:00
2025-10-15 13:24:33 -07:00
2025-10-07 08:40:15 -07:00
2025-10-14 10:38:10 +02:00
2025-09-30 16:07:10 -07:00
2025-04-30 21:53:35 +02:00
2025-10-24 11:38:39 +02:00
2025-10-02 08:31:44 -07:00
2025-05-14 13:16:24 +02:00
2025-09-29 09:42:35 +02:00
2025-09-24 14:29:14 -07:00
2025-09-29 12:54:01 +02:00
2025-10-04 11:13:11 -07:00
2025-10-07 08:40:15 -07:00
2025-10-26 09:42:19 -07:00
2025-10-20 19:56:12 +02:00
2025-11-01 01:10:29 +09:00
2025-07-31 10:20:11 -04:00
2025-06-24 20:30:37 +09:00
2025-09-27 20:13:56 -04:00
2025-09-23 12:37:35 +02:00
2025-10-03 10:19:44 -07:00
2025-09-23 12:37:35 +02:00
2025-09-10 19:55:00 -04:00
2025-08-30 10:15:28 -04:00
2025-09-30 08:22:16 -07:00
2025-08-30 10:15:30 -04:00
2025-03-07 22:03:09 -06:00
2025-07-31 18:23:53 -07:00
2025-03-04 18:44:29 -08:00
2025-08-06 22:48:12 +02:00
2025-09-13 17:32:55 -07:00
2025-09-13 17:32:55 -07:00
2025-05-21 10:48:21 -07:00
2025-07-19 19:08:23 -07:00
2025-09-01 15:31:34 +02:00
2025-05-27 19:40:33 -07:00
2025-09-21 14:22:00 -07:00
2025-10-02 18:44:54 -07:00
2025-09-21 14:22:35 -07:00
2025-08-06 10:23:36 +09:00
2025-09-13 17:32:43 -07:00
2025-02-21 15:05:38 +01:00
2025-03-10 11:54:46 +01:00
2025-09-28 11:36:14 -07:00
2025-07-16 18:34:42 -07:00
2025-02-21 10:25:33 +01:00
2025-02-21 09:20:30 +01:00
2025-09-13 17:32:55 -07:00
2025-09-17 16:25:41 +02:00
2025-09-13 17:32:44 -07:00
2025-09-13 17:32:49 -07:00
2025-03-16 22:30:47 -07:00
2025-09-13 17:32:43 -07:00
2025-10-07 13:48:55 -07:00
2025-08-02 12:01:38 -07:00
2025-08-02 12:01:38 -07:00
2025-07-15 18:45:34 +09:00
2025-07-21 21:40:39 -07:00
2025-08-13 08:34:33 +02:00
2025-01-28 13:48:37 +01:00
2025-10-02 18:44:54 -07:00
2025-09-25 09:23:54 +02:00
2025-09-29 11:20:29 -07:00
2025-09-25 09:23:54 +02:00
2025-09-13 12:11:06 +08:00
2025-09-28 11:36:13 -07:00
2025-08-16 21:47:25 +02:00
2025-09-29 11:20:29 -07:00
2025-01-28 13:48:37 +01:00
2025-09-29 11:20:29 -07:00
2025-05-11 17:48:15 -07:00
2025-04-01 10:06:52 -07:00
2025-07-09 22:57:52 -07:00
2025-09-21 14:22:34 -07:00
2025-09-13 19:51:59 +02:00
2025-09-30 11:11:21 -07:00
2025-08-19 13:51:28 +02:00
2025-09-18 22:21:28 +02:00
2025-06-13 08:47:20 +02:00
2025-09-17 16:25:41 +02:00
2025-03-30 15:44:36 -07:00
2025-07-01 15:02:03 +02:00
2025-08-21 20:09:20 +02:00
2025-10-02 18:44:54 -07:00
2025-04-14 14:13:41 +02:00
2025-07-23 11:56:02 +02:00
2025-08-14 15:26:30 -07:00
2025-03-21 15:30:10 -04:00
2025-08-19 13:38:20 +02:00
2025-08-02 12:01:38 -07:00
2025-01-28 13:48:37 +01:00
2025-09-25 09:23:54 +02:00
2025-09-25 09:23:54 +02:00
2025-01-28 13:48:37 +01:00
2025-09-29 11:20:29 -07:00
2025-09-21 17:44:20 -04:00
2025-05-11 17:54:04 -07:00
2025-03-24 09:52:37 -07:00
2025-07-31 11:28:03 -04:00
2025-09-13 17:32:53 -07:00
2025-09-13 17:32:53 -07:00
2025-09-16 10:33:53 -10:00