[Bug 231445] [patch] sleepq_catch_signals will still enter sleep after a ptrace attach event

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Sep 18 10:56:08 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231445

            Bug ID: 231445
           Summary: [patch] sleepq_catch_signals will still enter sleep
                    after a ptrace attach event
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs at FreeBSD.org
          Reporter: valmarelox at gmail.com

Created attachment 197188
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=197188&action=edit
patch

If a ptrace attach SIGSTOP is queued to a process while that process is on a
sleep queue but has not yet entered sleep, the signal will not abort the sleep.

This behavior which contradicts the expected behavior that happens when the
process is interrupted mid sleep - it aborts the sleep and will continue from a
user mode boundary when continued.

In the current condition after the process is restarted, it will immediately
enter the sleep as if no signal was received (this is due to issignal deleting
signals handled by ptracestop and returning 0, where sleepq_catch_signals uses
the return value in the pending signals check prior to entering sleep).

A proposed patch is attached.
I reproduced this issue on a FreeBSD12-CURRENT amd64 machine running on QEMU
with multiple cores.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list