Steven Rostedt (Google)
e0213434fe
tracing: Do not let histogram values have some modifiers
Histogram values can not be strings, stacktraces, graphs, symbols,
syscalls, or grouped in buckets or log. Give an error if a value is set to
do so.
Note, the histogram code was not prepared to handle these modifiers for
histograms and caused a bug.
Mark Rutland reported:
# echo 'p:copy_to_user __arch_copy_to_user n=$arg2' >> /sys/kernel/tracing/kprobe_events
# echo 'hist:keys=n:vals=hitcount.buckets=8:sort=hitcount' > /sys/kernel/tracing/events/kprobes/copy_to_user/trigger
# cat /sys/kernel/tracing/events/kprobes/copy_to_user/hist
[ 143.694628] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
[ 143.695190] Mem abort info:
[ 143.695362] ESR = 0x0000000096000004
[ 143.695604] EC = 0x25: DABT (current EL), IL = 32 bits
[ 143.695889] SET = 0, FnV = 0
[ 143.696077] EA = 0, S1PTW = 0
[ 143.696302] FSC = 0x04: level 0 translation fault
[ 143.702381] Data abort info:
[ 143.702614] ISV = 0, ISS = 0x00000004
[ 143.702832] CM = 0, WnR = 0
[ 143.703087] user pgtable: 4k pages, 48-bit VAs, pgdp=00000000448f9000
[ 143.703407] [0000000000000000] pgd=0000000000000000, p4d=0000000000000000
[ 143.704137] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
[ 143.704714] Modules linked in:
[ 143.705273] CPU: 0 PID: 133 Comm: cat Not tainted 6.2.0-00003-g6fc512c10a7c #3
[ 143.706138] Hardware name: linux,dummy-virt (DT)
[ 143.706723] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 143.707120] pc : hist_field_name.part.0+0x14/0x140
[ 143.707504] lr : hist_field_name.part.0+0x104/0x140
[ 143.707774] sp : ffff800008333a30
[ 143.707952] x29: ffff800008333a30 x28: 0000000000000001 x27: 0000000000400cc0
[ 143.708429] x26: ffffd7a653b20260 x25: 0000000000000000 x24: ffff10d303ee5800
[ 143.708776] x23: ffffd7a6539b27b0 x22: ffff10d303fb8c00 x21: 0000000000000001
[ 143.709127] x20: ffff10d303ec2000 x19: 0000000000000000 x18: 0000000000000000
[ 143.709478] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[ 143.709824] x14: 0000000000000000 x13: 203a6f666e692072 x12: 6567676972742023
[ 143.710179] x11: 0a230a6d6172676f x10: 000000000000002c x9 : ffffd7a6521e018c
[ 143.710584] x8 : 000000000000002c x7 : 7f7f7f7f7f7f7f7f x6 : 000000000000002c
[ 143.710915] x5 : ffff10d303b0103e x4 : ffffd7a653b20261 x3 : 000000000000003d
[ 143.711239] x2 : 0000000000020001 x1 : 0000000000000001 x0 : 0000000000000000
[ 143.711746] Call trace:
[ 143.712115] hist_field_name.part.0+0x14/0x140
[ 143.712642] hist_field_name.part.0+0x104/0x140
[ 143.712925] hist_field_print+0x28/0x140
[ 143.713125] event_hist_trigger_print+0x174/0x4d0
[ 143.713348] hist_show+0xf8/0x980
[ 143.713521] seq_read_iter+0x1bc/0x4b0
[ 143.713711] seq_read+0x8c/0xc4
[ 143.713876] vfs_read+0xc8/0x2a4
[ 143.714043] ksys_read+0x70/0xfc
[ 143.714218] __arm64_sys_read+0x24/0x30
[ 143.714400] invoke_syscall+0x50/0x120
[ 143.714587] el0_svc_common.constprop.0+0x4c/0x100
[ 143.714807] do_el0_svc+0x44/0xd0
[ 143.714970] el0_svc+0x2c/0x84
[ 143.715134] el0t_64_sync_handler+0xbc/0x140
[ 143.715334] el0t_64_sync+0x190/0x194
[ 143.715742] Code: a9bd7bfd 910003fd a90153f3 aa0003f3 (f9400000)
[ 143.716510] ---[ end trace 0000000000000000 ]---
Segmentation fault
Link: https://lkml.kernel.org/r/20230302020810.559462599@goodmis.org
Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Fixes: c6afad49d1 ("tracing: Add hist trigger 'sym' and 'sym-offset' modifiers")
Reported-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2023-03-09 22:17:06 -05:00
..
2023-01-13 17:18:35 +01:00
2022-12-13 19:29:45 -08:00
2022-12-01 00:09:20 +01:00
2022-12-02 11:25:00 +01:00
2022-12-21 08:45:38 +01:00
2022-10-03 14:03:25 -07:00
2022-12-27 12:44:01 +01:00
2023-01-01 11:15:05 -08:00
2022-12-21 14:31:52 -08:00
2022-12-16 14:04:04 +00:00
2023-01-02 08:59:33 -08:00
2022-12-13 14:05:39 -08:00
2023-01-01 11:15:05 -08:00
2022-12-19 07:13:33 -06:00
2022-12-06 12:04:34 +01:00
2023-01-19 14:56:38 +01:00
2022-12-21 07:59:57 -08:00
2023-01-09 11:43:23 +01:00
2023-01-03 11:07:58 +01:00
2023-03-09 22:17:06 -05:00
2022-11-30 16:13:18 -08:00
2022-02-03 11:20:34 -08:00
2022-08-22 18:50:06 -04:00
2022-04-25 14:37:28 +02:00
2022-09-01 17:39:30 -04:00
2022-08-29 19:47:03 -04:00
2022-09-07 11:30:15 -04:00
2022-01-11 13:08:21 -08:00
2022-10-17 14:24:42 -04:00
2022-09-26 19:46:09 -07:00
2022-10-26 10:02:39 +02:00
2022-09-26 10:13:13 -07:00
2022-07-05 13:33:00 -07:00
2022-07-05 13:32:59 -07:00
2022-12-02 12:43:02 +01:00
2022-11-30 16:13:17 -08:00
2022-11-01 10:04:52 -07:00
2022-09-26 19:46:07 -07:00
2022-12-16 12:26:57 -08:00
2022-07-05 13:32:59 -07:00
2022-09-11 21:55:11 -07:00
2022-12-17 14:06:53 -06:00
2022-09-07 21:53:50 +02:00
2023-01-18 16:34:04 +09:00
2022-07-15 18:21:49 +00:00
2022-09-30 16:50:39 +02:00
2022-04-15 14:49:55 -07:00
2022-12-01 15:53:05 -08:00
2022-11-12 18:47:36 -08:00
2023-01-13 15:09:08 -08:00
2022-11-15 00:42:02 -08:00
2022-11-15 00:42:02 -08:00
2022-03-31 10:36:55 +02:00
2022-10-03 14:03:23 -07:00
2022-11-18 13:55:07 -08:00
2022-11-18 13:55:07 -08:00
2022-09-11 21:55:06 -07:00
2022-09-11 21:55:06 -07:00
2022-12-15 08:48:40 +09:00
2022-11-10 19:07:31 +01:00
2022-10-09 16:01:59 -07:00
2022-09-11 21:55:12 -07:00
2022-12-23 12:00:24 -08:00
2022-11-30 19:32:30 +01:00
2022-10-25 15:15:52 -07:00
2022-12-19 12:33:32 -06:00
2022-12-23 12:00:24 -08:00
2022-12-16 03:54:54 -08:00
2022-04-29 14:38:00 -07:00
2022-06-29 13:07:16 +02:00
2022-09-11 21:55:12 -07:00
2022-09-07 21:53:50 +02:00
2022-10-04 15:59:36 +02:00
2022-12-11 19:30:19 -08:00
2022-12-16 03:54:54 -08:00
2022-11-14 09:58:32 +01:00
2022-04-11 17:07:29 -07:00
2022-11-09 18:06:35 +00:00
2022-05-03 14:11:58 -07:00
2022-12-14 12:20:00 -08:00
2022-10-10 12:49:34 -07:00
2022-09-11 21:55:10 -07:00
2022-07-05 13:32:59 -07:00
2022-05-08 01:33:09 -07:00
2022-02-25 09:36:06 +01:00
2022-10-17 16:41:16 +02:00
2022-04-05 09:59:38 +02:00
2022-05-24 11:11:13 -07:00
2022-08-20 15:17:45 -07:00
2023-01-21 16:14:17 +01:00
2022-09-08 16:56:45 -07:00
2022-12-13 19:29:45 -08:00
2022-09-11 21:55:10 -07:00
2022-08-29 12:47:15 +01:00
2022-02-01 17:24:39 -08:00
2023-02-18 14:34:36 -05:00
2022-04-29 14:38:03 -07:00
2022-05-18 18:24:57 -05:00
2022-09-07 21:53:50 +02:00
2022-10-09 16:24:05 -07:00
2022-11-30 20:16:49 -04:00
2022-05-19 23:25:47 -04:00
2022-10-23 12:01:01 -07:00
2022-08-02 19:24:24 -07:00
2022-06-23 18:41:40 +02:00
2022-08-06 16:38:17 -07:00
2022-11-30 13:17:05 -08:00