fix(auth): prevent infinite PAM retry loops on lock screen - #4294
Open
ConstantinJean wants to merge 1 commit into
Open
fix(auth): prevent infinite PAM retry loops on lock screen#4294ConstantinJean wants to merge 1 commit into
ConstantinJean wants to merge 1 commit into
Conversation
Collaborator
|
The description now contains the required template structure. |
ConstantinJean
marked this pull request as ready for review
September 5, 2026 18:02
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.
Summary
Only submit the user's password once per PAM conversation in
pam_authenticator.cpp. If PAM prompts for authentication again within the same conversation session (e.g. retry loops), returnPAM_CONV_ERRimmediately instead of re-supplying the cached password.Motivation
When authenticating against
systemd-homedencrypted homes,pam_systemd_homeimplements an internal retry loop (up to 5 attempts) on authentication failure.Because Noctalia was answering all
PAM_PROMPT_ECHO_OFFqueries with the cached password, failed attempts causedsystemd-homedto run 5 sequential cryptographic verifications , resulting in a ~15-second freeze on the lock screen.Aborting the conversation on subsequent prompts aligns with the PAM conversation specification and matches the approach used by other Wayland lockers (e.g. swaylock), reducing the lockout delay to a single attempt (~3.0 seconds).
Type of Change
Related Issue
Close #4283
Testing
Manual testing on Arch Linux (systemd 261, systemd-homed with btrfs/LUKS):
systemd-homeworkattempts for ~15 seconds before failing.pam_systemd_homereturnedConversation erroron attempt 2 and terminated cleanly.Didn't test on non systemd-homed session.
Manual Coverage
Checklist
CONTRIBUTING.md.just formatwith clang-format v22+ installed, or this PR has no code changes.docs/user/when this PR changes documented behavior or configuration, or this PR does not require documentation changes.assets/translations/en.json, or this PR adds no new user-facing strings.