public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@strace.io>
To: Alejandro Colomar <alx.manpages@gmail.com>
Cc: "Φώτης Βαλασιάδης" <fvalasiad@gmail.com>,
	linux-man@vger.kernel.org, mtk.manpages@gmail.com,
	lineprinter0@gmail.com
Subject: Re: [PATCH] ptrace.2: Add details about usage of PTRACE_GET_SYSCALL_INFO
Date: Mon, 27 Feb 2023 17:33:40 +0200	[thread overview]
Message-ID: <20230227153340.GA9755@altlinux.org> (raw)
In-Reply-To: <d9c8e11d-9586-a13f-6195-f376cbbc444a@gmail.com>

Hi,

On Mon, Feb 27, 2023 at 02:28:45PM +0100, Alejandro Colomar wrote:
[...]
> Ahh, sorry, I forgot about that.  I reworded it to the following:
> 
>     ptrace.2: Add details about usage of PTRACE_GET_SYSCALL_INFO
>     
>     Document the role of PTRACE_O_TRACESYSGOOD option in connection with
>     PTRACE_GET_SYSCALL_INFO.
>     
>     Came upon this after writing a test program using PTRACE_O_TRACESYSGOOD.

Just otherwise, PTRACE_O_TRACESYSGOOD was not used in that test,
otherwise there wouldn't be any question in the first place.
Did you mean PTRACE_GET_SYSCALL_INFO?

>     After failing to find what's wrong I posted a StackOverflow question
>     which you can find right here:
>     <https://stackoverflow.com/questions/72410182/ptrace-get-syscall-info-always-returns-info-op-as-ptrace-syscall-info-none>
>     
>     Nate Eldredge found out what happens by looking into the kernel's source
>     code, here is a link to the relevant part
>     <https://github.com/torvalds/linux/blob/8291eaafed36f575f23951f3ce18407f480e9ecf/kernel/ptrace.c#L1018>
>     
>     In the code it can be seen that the union is filled if and only if the
>     signal matches "SIGTRAP | 0x80", a signal which is only sent if the
>     PTRACE_O_TRACESYSGOOD option is set.  You can read about that in the
>     PTRACE_O_TRACESYSGOOD section of ptrace(2)'s manual.

Once again, this "if and only if" is confusing, as PTRACE_EVENT_SECCOMP
event that can happen when PTRACE_O_TRACESECCOMP option is enabled
fills the union with the data of type PTRACE_SYSCALL_INFO_SECCOMP.

PTRACE_EVENT_SECCOMP stop is similar to system call enter stop, but it's
not exactly the same kind of stop.

The note we're adding to the manual page is more correct in this regards.


-- 
ldv

  reply	other threads:[~2023-02-27 15:34 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-25 10:56 [PATCH] ptrace.2: Add details about usage of PTRACE_GET_SYSCALL_INFO Fotios Valasiadis
2023-02-26 21:58 ` Alejandro Colomar
2023-02-26 22:03   ` Dmitry V . Levin
2023-02-26 22:05     ` Alejandro Colomar
2023-02-26 22:14       ` Φώτης Βαλασιάδης
2023-02-26 22:42         ` Alejandro Colomar
2023-02-26 23:30           ` Φώτης Βαλασιάδης
2023-02-26 23:22 ` Fotios Valasiadis
2023-02-27  0:19   ` Alejandro Colomar
2023-02-27  0:41     ` Φώτης Βαλασιάδης
2023-02-27 13:28       ` Alejandro Colomar
2023-02-27 15:33         ` Dmitry V. Levin [this message]
2023-02-27 15:35           ` Alejandro Colomar
     [not found]             ` <b57591a9-5ba1-5192-f376-f2de812a9086@gmail.com>
2023-02-27 17:30               ` Fwd: " Φώτης Βαλασιάδης
2023-02-27 18:48               ` Alejandro Colomar
2023-02-27 19:17                 ` Fotios Valasiadis
2023-02-27 19:19                   ` Φώτης Βαλασιάδης
2023-03-01 19:28                     ` Φώτης Βαλασιάδης
2023-03-01 21:00                   ` Alejandro Colomar
  -- strict thread matches above, loose matches on Subject: below --
2023-02-25  2:42 Fotios Valasiadis
2023-02-25 10:10 ` Dmitry V . Levin
2023-02-25 10:33   ` Φώτης Βαλασιάδης
2023-02-25 10:42     ` Dmitry V . Levin
2023-02-24 16:31 Fotios Valasiadis
2023-02-24 18:53 ` Dmitry V. Levin
2023-02-24 19:11   ` Φώτης Βαλασιάδης
2023-02-24 22:05     ` Dmitry V. Levin
2023-02-24 23:05       ` Φώτης Βαλασιάδης
2023-02-24 23:31         ` Dmitry V. Levin
2023-02-24 23:43           ` Φώτης Βαλασιάδης
2023-02-25  0:08             ` Dmitry V. Levin
2023-02-25  1:21               ` Alex Colomar
2023-02-25  9:39                 ` Dmitry V. Levin
2023-02-25  1:18 ` Alex Colomar
2023-02-25  1:36   ` Φώτης Βαλασιάδης
2023-02-25  2:07   ` Nate Eldredge

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=20230227153340.GA9755@altlinux.org \
    --to=ldv@strace.io \
    --cc=alx.manpages@gmail.com \
    --cc=fvalasiad@gmail.com \
    --cc=lineprinter0@gmail.com \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.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