This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] S390: Sync ptrace.h with kernel. [BZ #21539]
- From: Florian Weimer <fweimer at redhat dot com>
- To: Stefan Liebler <stli at linux dot vnet dot ibm dot com>, libc-alpha at sourceware dot org
- Date: Fri, 7 Jul 2017 12:45:15 +0200
- Subject: Re: [PATCH] S390: Sync ptrace.h with kernel. [BZ #21539]
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 49F4B85543
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 49F4B85543
- References: <bda685cb-c5c4-ab27-47e0-1e95223275f9@linux.vnet.ibm.com> <20170613200522.GA14306@altlinux.org> <a70194fb-d96c-d22f-7aba-36be9685d421@linux.vnet.ibm.com> <a0750c84-154a-e24c-acfd-4899ce67a1ef@redhat.com> <7ce52670-669c-d9c0-dcf0-4d328bbeda79@linux.vnet.ibm.com> <b2dc07f8-a779-a51a-d239-c2139008ebc3@redhat.com> <ad89c386-7c5e-e783-037a-213bb3561847@linux.vnet.ibm.com> <bb27ad09-7f36-0fef-4669-94466a169bb1@linux.vnet.ibm.com>
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