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] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 23 Mar 2010 16:56:15 +0530
From:	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...e.hu>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Masami Hiramatsu <mhiramat@...hat.com>,
	Mel Gorman <mel@....ul.ie>,
	Ananth N Mavinakayanahalli <ananth@...ibm.com>,
	Jim Keniston <jkenisto@...ux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	"Frank Ch. Eigler" <fche@...hat.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Randy Dunlap <randy.dunlap@...cle.com>
Subject: Re: [PATCH v1 4/10] User Space Breakpoint Assistance Layer

> 
> > User Space Breakpoint Assistance Layer (USER_BKPT)
> > 
> 
> A quick scan, just to show I was paying attention ;)

Thanks for taking a look and commenting on the code.

> 
> > +int user_bkpt_read_vm(struct task_struct *tsk, unsigned long vaddr,
> > +						void *kbuf, int nbytes)
> > +{
> > +	if (tsk == current) {
> > +		int nleft = copy_from_user(kbuf, (void __user *) vaddr,
> > +				nbytes);
> > +		return nbytes - nleft;
> > +	} else
> > +		return access_process_vm(tsk, vaddr, kbuf, nbytes, 0);
> > +}
> 
> copy_from_user() takes and returns an unsigned long arg but this
> function is converting these to and from ints.  That's OK if we're 100%
> sure that we'll never get or return an arg >2G.  Otherwise things could
> get ghastly.  Please have a think.  (Dittoes for some other functionss
> around here).
> 

nbytes would not be greater than the maximum size of a instruction for
that architecture. Hence I dont see it going above 2G. However I will
take a relook.


I will rework the rest of the comments as suggested by you.
It would be part of the next version.

--
Thanks and Regards
Srikar
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ