lkml.org 
[lkml]   [2014]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] ptrace: Clarify PTRACE_GETREGSET/PTRACE_SETREGSET, documentation in uapi header
On 06/12, Anshuman Khandual wrote:
>
> > --- a/include/uapi/linux/ptrace.h
> > +++ b/include/uapi/linux/ptrace.h
> > @@ -39,12 +39,17 @@
> > * payload are exactly the same layout.
> > *
> > * This interface usage is as follows:
> > - * struct iovec iov = { buf, len};
> > + * struct iovec iov = { buf, len };
> > *
> > * ret = ptrace(PTRACE_GETREGSET/PTRACE_SETREGSET, pid, NT_XXX_TYPE, &iov);
> > *
> > - * On the successful completion, iov.len will be updated by the kernel,
> > - * specifying how much the kernel has written/read to/from the user's iov.buf.
> > + * On entry, iov describes the buffer's address and length. The buffer's length
> > + * must be a multiple of the size of a single register in the register set. The
> > + * kernel never reads or writes more than iov.len, and caps the buffer length to
> > + * the register set's size. In other words, the kernel reads or writes
> > + * min(iov.len, regset size).

I think this should be self-obvious ;) otherwise why do we need to pass
the length of the buffer?

But of course I won't argue with the additional documentation, perhaps you
can re-send this patch to akpm? Usually ptrace changes are routed via -mm
tree.

But if we update the kernel header, then probably it would be more important
to update the man-page. To me the description of GETREGSET looks good, but
probably it could also mention that buflen should be multiple of regsize (as
you did above). Add Michael.

Oleg.



\
 
 \ /
  Last update: 2014-06-12 20:41    [W:0.126 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site