Kernel Newbies archive on lore.kernel.org
 help / Atom feed
* Purpose of PTRACE_SETSIGINFO for x86
@ 2018-12-14 22:30 Okash Khawaja
  0 siblings, 0 replies; 1+ messages in thread
From: Okash Khawaja @ 2018-12-14 22:30 UTC (permalink / raw)
  To: kernelnewbies

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

^ permalink raw reply	[flat|nested] 1+ messages in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-14 22:30 Purpose of PTRACE_SETSIGINFO for x86 Okash Khawaja

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org kernelnewbies@archiver.kernel.org
	public-inbox-index kernelnewbies


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/ public-inbox