lkml.org 
[lkml]   [2010]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2010-03-23 12:29    [W:0.060 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site