[PATCH] S390: Sync ptrace.h with kernel. [BZ #21539]
Stefan Liebler
stli@linux.vnet.ibm.com
Fri Jul 7 13:54:00 GMT 2017
On 07/07/2017 12:45 PM, Florian Weimer wrote:
> On 07/07/2017 12:22 PM, Stefan Liebler wrote:
>> + /* Ptrace request 12 is done with zero data argument:
>> + -If the kernel has support for PTRACE_SINGLEBLOCK (then the kernel
>> + header asm/ptrace.h defines this macro), the ptrace call is not allowed
>> + to fail and has to continue the tracee until next taken branch.
>> +
>> + -If the kernel (<3.15) has no support for PTRACE_SINGLEBLOCK, the
>> + ptrace call has to fail with EIO. Then I continue the tracee with
>> + PTRACE_CONT.
>> +
>> + -If the request 12 is interpreted as PTRACE_GETREGS, it will fail too.
>> + It fails with EFAULT on intel / power as data argument is NULL.
>> + According to the man-page: "Unfortunately, under Linux, different
>> + variations of this fault will return EIO or EFAULT more or less
>> + arbitrarily".
>> + But if request 12 is interpreted as PTRACE_GETREGS, the first ptrace
>> + call will touch the buffer which is detected by this test. */
>
> I think the comment is still a bit off. I think it is only necessary to
> retain the second two lines, the other things is already implied by the
> short comments in the code below.
okay. I removed the other lines.
>
> (I have not tested whether this actually works. I assume you have
> checked a couple of userspace/kernel permutations.)
Yes. I've run the test on several machines.
>
> Thanks,
> Florian
>
If this is okay, I'll commit it on Monday.
Bye.
Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20170707_1500_s390_ptrace_h.patch
Type: text/x-patch
Size: 4008 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170707/f184a16b/attachment.bin>
More information about the Libc-alpha
mailing list