Conversation
Reset inherited crash handlers before setting up the PAM helper so a module crash cannot relaunch the shell. Request a parent-death signal on Linux and FreeBSD, but treat setup as best effort: an unsupported or blocked call must not prevent password or fingerprint authentication. Check the parent PID after the request, in case the parent exited before the signal was configured.
alvarosth
force-pushed
the
pam-subprocess-parent-death
branch
from
October 3, 2026 21:19
31fc94e to
0d79217
Compare
Member
|
Crash/restart intentionally does not change PPID. Better approaches might be to
Then just unset the signal handlers from the parent process to get rid of crash handling in the subprocess. |
outfoxxed
force-pushed
the
master
branch
2 times, most recently
from
October 6, 2026 04:21
72a1ce2 to
11ca60b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PAM helpers can outlive the shell and keep the fingerprint reader busy until PAM times out. They also inherit the shell’s crash handler, so a PAM module crash can launch another shell.
Reset the helper’s crash handlers and request SIGKILL when its parent dies, with a PID check to cover the setup race. The signal request is best effort so a blocked or unsupported call won’t prevent authentication.
Both Linux reproductions fail on master and pass with this change: killing the shell stops the helper, and crashing the helper no longer relaunches the shell. Authentication also succeeds when the signal request returns EPERM. FreeBSD is untested.
Fixes #1249