Darrick J. Wong
74bf97e9a8
tracing: Fix UBSAN warning in __remove_instance()
xfs/558 triggers the following UBSAN warning:
------------[ cut here ]------------
UBSAN: shift-out-of-bounds in kernel/trace/trace.c:10510:10
shift exponent 32 is too large for 32-bit type 'int'
CPU: 1 UID: 0 PID: 888674 Comm: rmdir Not tainted 6.19.0-rc1-xfsx #rc1 PREEMPT(lazy) dbf607ef4c142c563f76d706e71af9731d7b9c90
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-4.module+el8.8.0+21164+ed375313 04/01/2014
Call Trace:
<TASK>
dump_stack_lvl+0x4a/0x70
ubsan_epilogue+0x5/0x2b
__ubsan_handle_shift_out_of_bounds.cold+0x5e/0x113
__remove_instance.part.0.constprop.0.cold+0x18/0x26f
instance_rmdir+0xf3/0x110
tracefs_syscall_rmdir+0x4d/0x90
vfs_rmdir+0x139/0x230
do_rmdir+0x143/0x230
__x64_sys_rmdir+0x1d/0x20
do_syscall_64+0x44/0x230
entry_SYSCALL_64_after_hwframe+0x4b/0x53
RIP: 0033:0x7f7ae8e51f17
Code: f0 ff ff 73 01 c3 48 8b 0d de 2e 0e 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 b8 54 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 8b 15 b1 2e 0e 00 f7 d8 64 89 02 b8
RSP: 002b:00007ffd90743f08 EFLAGS: 00000246 ORIG_RAX: 0000000000000054
RAX: ffffffffffffffda RBX: 00007ffd907440f8 RCX: 00007f7ae8e51f17
RDX: 00007f7ae8f3c5c0 RSI: 00007ffd90744a21 RDI: 00007ffd90744a21
RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000000
R10: 00007f7ae8f35ac0 R11: 0000000000000246 R12: 00007ffd90744a21
R13: 0000000000000001 R14: 00007f7ae8f8b000 R15: 000055e5283e6a98
</TASK>
---[ end trace ]---
whilst tearing down an ftrace instance. TRACE_FLAGS_MAX_SIZE is now 64bit,
so the mask comparison expression must be typecast to a u64 value to
avoid an overflow. AFAICT, ZEROED_TRACE_FLAGS is already cast to ULL
so this is ok.
Link: https://patch.msgid.link/20251216174950.GA7705@frogsfrogsfrogs
Fixes: bbec8e28ca ("tracing: Allow tracer to add more than 32 options")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2025-12-17 17:50:04 -05:00
..
2025-12-05 14:36:21 -08:00
2025-12-05 13:52:43 -08:00
2025-11-12 10:00:14 -08:00
2025-10-24 12:56:20 +02:00
2025-12-11 08:14:23 +09:00
2025-11-04 08:35:37 +01:00
2025-12-09 12:22:25 +01:00
2025-12-10 17:21:30 +09:00
2025-11-09 21:19:44 -08:00
2025-12-14 06:07:09 +12:00
2025-10-02 08:31:44 -07:00
2025-12-03 13:46:48 -08:00
2025-12-10 16:07:44 -08:00
2025-12-03 12:18:07 -08:00
2025-12-06 14:01:20 -08:00
2025-11-28 16:50:45 +01:00
2025-12-05 17:29:04 -08:00
2025-12-03 12:18:07 -08:00
2025-12-06 12:31:21 -08:00
2025-12-05 17:29:04 -08:00
2025-12-17 17:50:04 -05:00
2025-10-29 10:29:58 +01:00
2025-06-24 20:30:37 +09:00
2025-11-04 12:36:49 +01: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-10-22 19:28:06 -04:00
2025-11-07 16:38:34 -05:00
2025-11-07 16:50:42 -05:00
2025-12-03 16:53:19 +01: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-11-14 10:01:52 +01:00
2025-12-10 15:49:11 +09:00
2025-09-13 17:32:55 -07:00
2025-11-15 10:52:01 -08:00
2025-05-21 10:48:21 -07:00
2025-11-12 10:00:15 -08:00
2025-12-01 13:45:41 -08:00
2025-05-27 19:40:33 -07:00
2025-12-06 14:01:20 -08:00
2025-12-06 14:01:20 -08:00
2025-10-30 20:10:27 +01:00
2025-08-06 10:23:36 +09:00
2025-11-20 14:03:43 -08:00
2025-02-21 15:05:38 +01:00
2025-01-13 22:40:36 -08:00
2025-03-10 11:54:46 +01:00
2025-09-28 11:36:14 -07:00
2025-11-24 16:56:24 +01:00
2025-02-21 10:25:33 +01:00
2025-02-21 09:20:30 +01:00
2025-11-27 14:24:33 -08:00
2025-09-17 16:25:41 +02:00
2025-09-13 17:32:44 -07:00
2025-11-27 14:24:42 -08:00
2025-03-16 22:30:47 -07:00
2025-09-13 17:32:43 -07:00
2025-08-02 12:01:38 -07:00
2025-08-02 12:01:38 -07:00
2024-12-24 09:46:49 +01:00
2025-07-15 18:45:34 +09:00
2025-11-27 15:44:53 +01:00
2025-11-27 14:24:42 -08:00
2025-10-16 11:13:53 +02:00
2025-01-28 13:48:37 +01:00
2025-11-27 14:24:33 -08:00
2025-11-11 10:01:31 +01:00
2025-11-14 13:10:38 +01:00
2025-11-14 13:10:38 +01:00
2025-11-14 18:15:49 +08:00
2025-12-06 14:01:20 -08:00
2025-08-16 21:47:25 +02:00
2025-11-11 10:01:32 +01:00
2025-01-28 13:48:37 +01:00
2025-11-11 10:01:32 +01:00
2025-11-04 08:30:50 +01:00
2025-04-01 10:06:52 -07:00
2025-11-16 17:28:11 -08:00
2025-11-27 14:24:45 -08:00
2025-11-04 08:34:39 +01:00
2024-11-14 16:09:51 -08:00
2025-11-12 10:00:13 -08:00
2025-09-30 11:11:21 -07:00
2025-11-25 19:45:40 +01:00
2025-11-19 18:06:50 +01: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-11-27 15:45:38 +01:00
2025-10-29 10:29:54 +01: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-11-11 10:01:32 +01: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-11-27 14:24:44 -08:00
2025-11-19 12:17:28 +01:00
2025-07-31 11:28:03 -04:00
2025-09-13 17:32:53 -07:00
2025-12-06 14:01:20 -08:00
2025-11-21 09:45:36 -10:00