Eiichi Tsukata
f01098c74b
tracing/uprobe: Fix NULL pointer dereference in trace_uprobe_create()
Just like the case of commit 8b05a3a7503c ("tracing/kprobes: Fix NULL
pointer dereference in trace_kprobe_create()"), writing an incorrectly
formatted string to uprobe_events can trigger NULL pointer dereference.
Reporeducer:
# echo r > /sys/kernel/debug/tracing/uprobe_events
dmesg:
BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 8000000079d12067 P4D 8000000079d12067 PUD 7b7ab067 PMD 0
Oops: 0000 [#1] PREEMPT SMP PTI
CPU: 0 PID: 1903 Comm: bash Not tainted 5.2.0-rc3+ #15
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-2.fc30 04/01/2014
RIP: 0010:strchr+0x0/0x30
Code: c0 eb 0d 84 c9 74 18 48 83 c0 01 48 39 d0 74 0f 0f b6 0c 07 3a 0c 06 74 ea 19 c0 83 c8 01 c3 31 c0 c3 0f 1f 84 00 00 00 00 00 <0f> b6 07 89 f2 40 38 f0 75 0e eb 13 0f b6 47 01 48 83 c
RSP: 0018:ffffb55fc0403d10 EFLAGS: 00010293
RAX: ffff993ffb793400 RBX: 0000000000000000 RCX: ffffffffa4852625
RDX: 0000000000000000 RSI: 000000000000002f RDI: 0000000000000000
RBP: ffffb55fc0403dd0 R08: ffff993ffb793400 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff993ff9cc1668 R14: 0000000000000001 R15: 0000000000000000
FS: 00007f30c5147700(0000) GS:ffff993ffda00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000007b628000 CR4: 00000000000006f0
Call Trace:
trace_uprobe_create+0xe6/0xb10
? __kmalloc_track_caller+0xe6/0x1c0
? __kmalloc+0xf0/0x1d0
? trace_uprobe_create+0xb10/0xb10
create_or_delete_trace_uprobe+0x35/0x90
? trace_uprobe_create+0xb10/0xb10
trace_run_command+0x9c/0xb0
trace_parse_run_command+0xf9/0x1eb
? probes_open+0x80/0x80
__vfs_write+0x43/0x90
vfs_write+0x14a/0x2a0
ksys_write+0xa2/0x170
do_syscall_64+0x7f/0x200
entry_SYSCALL_64_after_hwframe+0x49/0xbe
Link: http://lkml.kernel.org/r/20190614074026.8045-1-devel@etsukata.com
Cc: stable@vger.kernel.org
Fixes: 0597c49c69d5 ("tracing/uprobes: Use dyn_event framework for uprobe events")
Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Eiichi Tsukata <devel@etsukata.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2019-06-14 16:51:14 -04:00
..
2019-03-13 14:31:12 -06:00
2019-05-07 22:03:58 -07:00
2018-12-22 08:21:03 -05:00
2018-12-08 20:54:06 -05:00
2019-06-14 16:34:57 -04:00
2019-04-08 15:11:48 +02:00
2018-12-08 20:54:09 -05:00
2017-11-02 11:10:55 +01:00
2018-10-17 15:35:33 -04:00
2019-05-08 12:15:12 -04:00
2019-05-15 16:05:47 -07:00
2017-11-02 11:10:55 +01:00
2018-05-15 10:27:29 -07:00
2018-08-16 19:08:06 -04:00
2019-04-03 11:02:24 +02:00
2018-08-16 19:08:06 -04:00
2019-03-26 08:35:36 -04:00
2018-12-08 20:54:09 -05:00
2019-02-11 14:53:43 -05:00
2019-02-21 10:35:10 -05:00
2018-08-16 19:08:06 -04:00
2019-05-28 16:27:58 -04:00
2019-05-21 12:48:07 -04:00
2019-04-08 09:22:28 -04:00
2019-05-08 12:15:12 -04:00
2018-05-29 08:28:53 -04:00
2019-02-06 11:56:19 -05:00
2018-01-23 15:57:00 -05:00
2018-08-16 19:08:06 -04:00
2019-03-11 17:01:32 -07:00
2019-05-25 23:04:30 -04:00
2018-07-30 18:41:04 -04:00
2018-08-16 19:08:06 -04:00
2019-04-02 18:24:07 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-06-14 16:28:42 -04:00
2018-08-16 19:08:06 -04:00
2019-02-13 08:16:40 +01:00
2018-09-26 12:21:00 +03:00
2019-05-08 12:15:11 -04:00
2019-05-08 12:15:12 -04:00
2019-05-08 12:15:11 -04:00
2017-11-02 11:10:55 +01:00
2019-02-20 13:51:06 -05:00
2018-01-23 15:57:29 -05:00
2019-04-21 19:46:56 -04:00
2018-08-16 19:08:06 -04:00
2019-04-29 12:37:56 +02:00
2017-11-02 11:10:55 +01:00
2018-08-16 19:08:06 -04:00
2019-04-05 09:26:43 -04:00
2019-06-14 16:51:14 -04:00
2019-06-14 16:49:26 -04:00
2019-05-25 23:04:30 -04:00
2018-08-16 19:08:06 -04:00
2018-08-16 19:08:06 -04:00