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: <CAKgNAkjj=LnYSLrpteTjv+EcxVDQgObDkxCMgH-z4TQWZ=N3SQ@mail.gmail.com>
Date:	Thu, 12 Jun 2014 20:49:18 +0200
From:	"Michael Kerrisk (man-pages)" <mtk.manpages@...il.com>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Anshuman Khandual <khandual@...ux.vnet.ibm.com>,
	Pedro Alves <palves@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>,
	lkml <linux-kernel@...r.kernel.org>,
	"H. Peter Anvin" <hpa@...or.com>, suresh.b.siddha@...el.com
Subject: Re: [PATCH v2] ptrace: Clarify PTRACE_GETREGSET/PTRACE_SETREGSET,
 documentation in uapi header

On Thu, Jun 12, 2014 at 8:05 PM, Oleg Nesterov <oleg@...hat.com> wrote:
> 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.

Can someone send a patch, then?

Cheers,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
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