This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] S390: Sync ptrace.h with kernel. [BZ #21539]


On 07/07/2017 03:53 PM, Stefan Liebler wrote:
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.
Committed.

Bye.
Stefan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]