public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
To: Eiichi Tsukata <devel@etsukata.com>
Cc: rostedt@goodmis.org, mingo@redhat.com, mhiramat@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] tracing/uprobe: Fix NULL pointer dereference in trace_uprobe_create()
Date: Fri, 14 Jun 2019 17:59:57 +0530	[thread overview]
Message-ID: <20190614122957.GA16523@linux.vnet.ibm.com> (raw)
In-Reply-To: <20190614074026.8045-1-devel@etsukata.com>

* Eiichi Tsukata <devel@etsukata.com> [2019-06-14 16:40:25]:

> 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
> 
> Fixes: 0597c49c69d5 ("tracing/uprobes: Use dyn_event framework for uprobe events")
> Signed-off-by: Eiichi Tsukata <devel@etsukata.com>
> ---
>  kernel/trace/trace_uprobe.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 


Good Catch.

Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>

-- 
Thanks and Regards
Srikar Dronamraju


  parent reply	other threads:[~2019-06-14 12:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14  7:40 [PATCH 1/2] tracing/uprobe: Fix NULL pointer dereference in trace_uprobe_create() Eiichi Tsukata
2019-06-14  7:40 ` [PATCH 2/2] tracing/uprobe: Fix obsolete comment on trace_uprobe_create() Eiichi Tsukata
2019-06-14 12:32   ` Srikar Dronamraju
2019-06-14 12:29 ` Srikar Dronamraju [this message]
2019-06-21 14:22 ` [PATCH 1/2] tracing/uprobe: Fix NULL pointer dereference in trace_uprobe_create() Masami Hiramatsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190614122957.GA16523@linux.vnet.ibm.com \
    --to=srikar@linux.vnet.ibm.com \
    --cc=devel@etsukata.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox