Page MenuHomeFreeBSD

Don't clear p_ptevents on normal SIGKILL delivery
ClosedPublic

Authored by badger on Mar 10 2017, 3:37 AM.

Details

Summary

The ptrace() user has the option of discarding the signal. In such a
case, p_ptevents should not be modified. If the ptrace() user decides to
send a SIGKILL, ptevents will be cleared in ptracestop(). procfs events
do not have the capability to discard the signal, so continue to clear
the mask in that case.

Originally brought up in D9260.

Test Plan

It can be verified by configuring gdb to not pass SIGKILL that, without
this patch, sending a SIGKILL will result in lost LWP events. All
ptrace kyua tests still pass.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

badger created this revision.Mar 10 2017, 3:37 AM
jhb accepted this revision.Mar 10 2017, 6:19 PM

It would be nice to add a new test case for this if it isn't too much trouble.

sys/kern/kern_sig.c
2183 ↗(On Diff #26108)

I would maybe keep the SIGKILL: prefix

This revision is now accepted and ready to land.Mar 10 2017, 6:19 PM
In D9939#205622, @jhb wrote:

It would be nice to add a new test case for this if it isn't too much trouble.

I could do that.

sys/kern/kern_sig.c
2183 ↗(On Diff #26108)

I thought it was perhaps approaching the banal threshold due to its proximity to the sig == SIGKILL test, but it doesn't bother me to put it back.

badger edited edge metadata.Mar 11 2017, 4:15 PM
badger updated this revision to Diff 26149.
  • Add kyua test
  • restore SIGKILL: in comment
This revision now requires review to proceed.Mar 11 2017, 4:15 PM
This revision was automatically updated to reflect the committed changes.