Messages in this thread Patch in this message | | | From | Anshuman Khandual <> | Subject | [PATCH] ptrace: Fix PTRACE_GETREGSET/PTRACE_SETREGSET in code documentation | Date | Mon, 28 Apr 2014 16:30:53 +0530 |
| |
The current documentation is bit misleading and does not explicitly specify that iov.len need to be initialized failing which kernel may just ignore the ptrace request and never read from/write into the user specified buffer. This patch fixes the documentation.
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> --- include/uapi/linux/ptrace.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/uapi/linux/ptrace.h b/include/uapi/linux/ptrace.h index cf1019e..e9d6b37 100644 --- a/include/uapi/linux/ptrace.h +++ b/include/uapi/linux/ptrace.h @@ -43,8 +43,12 @@ * * 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. + * A non-zero value upto the max size of data expected to be written/read by the + * kernel in response to any NT_XXX_TYPE request type must be assigned to iov.len + * before initiating the ptrace call. If iov.len is 0, then kernel will neither + * read from or write into the user buffer specified. On 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. */ #define PTRACE_GETREGSET 0x4204 #define PTRACE_SETREGSET 0x4205 -- 1.7.11.7
| |