lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190208094220.83ae0df5c71a9cd8891e598d@kernel.org>
Date:   Fri, 8 Feb 2019 09:42:20 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     Andreas Ziegler <andreas.ziegler@....de>,
        Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/3] tracing: uprobes: Re-enable $comm support for
 uprobe events

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

> On Fri, 18 Jan 2019 13:44:25 +0900
> Masami Hiramatsu <mhiramat@...nel.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@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ