[Bug 3981] sshd can lose SIGTERM delivered during SIGHUP restart/re-exec

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Wed Sep 16 15:03:56 AEST 2026


https://bugzilla.mindrot.org/show_bug.cgi?id=3981

dambi at tio.cz <dambi at tio.cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #4 from dambi at tio.cz <dambi at tio.cz> ---
My apologies, but looking at committed changes, the fix does not look
correct and it leaves SIGTERM and SIGQUIT signals unblocked.

I admit these signal manipulating functions are a little bit confusing,
but in general signal is blocked if it is set in signal mask. And since
committed fix removes SIGTERM and SIGQUIT from osigset mask, those
signals remain unblocked.

There are currently two variants, how the fix could be approached:

[V1] Used in Solaris specific patch

 + sigaddset(&osigset, SIGTERM);
 + sigaddset(&osigset, SIGQUIT);
  sigprocmask(SIG_SETMASK, &osigset, NULL);
  sighup_restart();

[V2] Proposed by gpt-6

 + sigdelset(&nsigset, SIGTERM);
 + sigdelset(&nsigset, SIGQUIT);
 + sigprocmask(SIG_UNBLOCK, &nsigset, NULL);
 - sigprocmask(SIG_SETMASK, &osigset, NULL);
  sighup_restart();

I would personally prefer V1 which seems more intuitive to me, but I do
not have strong preference.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.


More information about the openssh-bugs mailing list