kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: Okash Khawaja <okash.khawaja@gmail.com>
To: kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Purpose of PTRACE_SETSIGINFO for x86
Date: Fri, 14 Dec 2018 22:30:42 +0000	[thread overview]
Message-ID: <CAOtcWM0YxqvZecP1SOvBLRn3ZNaSg2idicDuG0Fg-4ekVe02OA@mail.gmail.com> (raw)

Hi,

What does the PTRACE_SETSIGINFO ptrace command do?

I can see in kernel/ptrace.c:ptrace_request() it calls
ptrace_setsiginfo(), passing it the child's (tracee's) task descriptor
and siginfo_t instance originally passed in from user space.

ptrace_setsiginfo() sets child's last_siginfo to the siginfo_t
instance passed in. Now there are only two places where a
child->last_siginfo's value is read are in kernel/ptrace.c:

1. by the ptrace command PTRACE_GETSIGINFO
2. by the ptrace command PTRACE_LISTEN

There doesn't seem to be a place where value of last_siginfo is read
by signal handling code. There is however this comment in
kernel/signal.c:ptrace_signal():

/*
 * Update the siginfo structure if the signal has
 * changed.  If the debugger wanted something
 * specific in the siginfo structure then it should
 * have updated *info via PTRACE_SETSIGINFO.
 */

Where does PTRACE_SETSIGINFO update *info?

Thanks,
Okash

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

                 reply	other threads:[~2018-12-14 22:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CAOtcWM0YxqvZecP1SOvBLRn3ZNaSg2idicDuG0Fg-4ekVe02OA@mail.gmail.com \
    --to=okash.khawaja@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    /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 NNTP newsgroup(s).