public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Stefan Liebler <stli@linux.vnet.ibm.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH] S390: Sync ptrace.h with kernel. [BZ #21539]
Date: Fri, 07 Jul 2017 10:45:00 -0000	[thread overview]
Message-ID: <6d68f86b-321b-12ee-688e-02f7869c2951@redhat.com> (raw)
In-Reply-To: <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

  reply	other threads:[~2017-07-07 10:45 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-06 10:17 Stefan Liebler
2017-06-06 10:44 ` Andreas Schwab
2017-06-06 10:58   ` Dmitry V. Levin
2017-06-06 11:56   ` Stefan Liebler
2017-06-08 12:02     ` Stefan Liebler
2017-06-13 20:05 ` Dmitry V. Levin
2017-06-19 13:11   ` Stefan Liebler
2017-06-19 13:26     ` Dmitry V. Levin
2017-06-19 14:34       ` Stefan Liebler
2017-06-30 10:09     ` Florian Weimer
2017-07-04  8:22       ` Stefan Liebler
2017-07-04  9:41         ` Florian Weimer
2017-07-04 15:37           ` Stefan Liebler
2017-07-07 10:22             ` Stefan Liebler
2017-07-07 10:45               ` Florian Weimer [this message]
2017-07-07 13:54                 ` Stefan Liebler
2017-07-11  8:39                   ` Stefan Liebler
2017-07-18 10:20     ` Dmitry V. Levin
2017-07-18 13:31       ` Carlos O'Donell
2017-07-18 13:39         ` Dmitry V. Levin
2017-07-18 14:11           ` Carlos O'Donell
2017-07-18 14:28             ` Mark Wielaard
2017-07-18 14:40               ` Mark Wielaard
2017-07-20  7:38             ` Stefan Liebler
2017-07-20  8:07               ` Carlos O'Donell
2017-07-20  8:32                 ` Stefan Liebler
2017-07-24  3:51                   ` Dmitry V. Levin
2017-07-24  7:18                     ` Stefan Liebler
2017-07-18 13:41       ` Stefan Liebler
2017-07-18 14:12         ` Carlos O'Donell
2017-07-18 14:16         ` Dmitry V. Levin
2017-07-19  8:40           ` Stefan Liebler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6d68f86b-321b-12ee-688e-02f7869c2951@redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=stli@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).