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

Florian Weimer fweimer@redhat.com
Fri Jul 7 10:45:00 GMT 2017


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.

(I have not tested whether this actually works.  I assume you have
checked a couple of userspace/kernel permutations.)

Thanks,
Florian



More information about the Libc-alpha mailing list