public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Andreas Ziegler <andreas.ziegler@fau.de>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] tracing: uprobes: Re-enable $comm support for uprobe events
Date: Fri, 8 Feb 2019 09:42:20 +0900	[thread overview]
Message-ID: <20190208094220.83ae0df5c71a9cd8891e598d@kernel.org> (raw)
In-Reply-To: <20190206155243.725bc30d@gandalf.local.home>

On Wed, 6 Feb 2019 15:52:43 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Fri, 18 Jan 2019 13:44:25 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
> 
> > @@ -180,7 +183,12 @@ fetch_store_strlen(unsigned long addr)
> >  	int len;
> >  	void __user *vaddr = (void __force __user *) addr;
> >  
> > -	len = strnlen_user(vaddr, MAX_STRING_SIZE);
> > +	if (addr == (unsigned long)current->comm) {
> > +		len = strlen(current->comm);
> > +		if (len)
> > +			len++;
> 
> Why only add 1 if len is non zero? Why not always do it.
> 
> One thing, len should always be greater than 0, and the other is that
> this makes it inconsistent with the NULL case of reading the address in
> userspace.

Agreed, it should not 0, so it should be;
len = strlen(current->comm) + 1;

Thank you!

> 
> -- Steve
> 
> 
> > +	} else
> > +		len = strnlen_user(vaddr, MAX_STRING_SIZE);
> >  
> >  	return (len > MAX_STRING_SIZE) ? 0 : len;


-- 
Masami Hiramatsu <mhiramat@kernel.org>

  reply	other threads:[~2019-02-08  0:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18  4:43 [PATCH v2 0/3] tracing: probeevent: Fix probe argument parser and handler Masami Hiramatsu
2019-01-18  4:44 ` [PATCH v2 1/3] tracing: uprobes: Re-enable $comm support for uprobe events Masami Hiramatsu
2019-01-23  8:40   ` Steven Rostedt
2019-01-24  1:43     ` Masami Hiramatsu
2019-01-24  2:09       ` Steven Rostedt
2019-01-24  3:03         ` Masami Hiramatsu
2019-02-06 20:52   ` Steven Rostedt
2019-02-08  0:42     ` Masami Hiramatsu [this message]
2019-01-18  4:44 ` [PATCH v2 2/3] tracing: probeevent: Do not accumulate on ret variable Masami Hiramatsu
2019-01-18  4:45 ` [PATCH v2 3/3] tracing: probeevent: Fix to make the type of $comm string 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=20190208094220.83ae0df5c71a9cd8891e598d@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=andreas.ziegler@fau.de \
    --cc=linux-kernel@vger.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