]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r315412, r314852:
authorbadger <badger@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 25 Mar 2017 20:14:08 +0000 (20:14 +0000)
committerbadger <badger@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 25 Mar 2017 20:14:08 +0000 (20:14 +0000)
commit47aa8a5d60058b4dcaae5c6ce12fa0b3f3eba037
tree9a54a23d2d4f0a330b9d9f23f24f1f18ff93c83d
parent42f0885366d327c8b75678afd37ef513359cc9f2
MFC r315412, r314852:

r315412:
    Don't clear p_ptevents on normal SIGKILL delivery

    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.

r314852:
    don't stop in issignal() if P_SINGLE_EXIT is set

    Suppose a traced process is stopped in ptracestop() due to receipt of a
    SIGSTOP signal, and is awaiting orders from the tracing process on how
    to handle the signal. Before sending any such orders, the tracing
    process exits. This should kill the traced process. But suppose a second
    thread handles the SIGKILL and proceeds to exit1(), calling
    thread_single(). The first thread will now awaken and will have a chance
    to check once more if it should go to sleep due to the SIGSTOP.  It must
    not sleep after P_SINGLE_EXIT has been set; this would prevent the
    SIGKILL from taking effect, leaving a stopped orphan behind after the
    tracing process dies.

    Also add new tests for this condition.

Sponsored by: Dell EMC

git-svn-id: svn://svn.freebsd.org/base/stable/10@315963 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/kern/kern_sig.c
tests/sys/kern/ptrace_test.c