Skip to content

pam: back off when auth fails without a conversation - #1085

Open
martintrojer wants to merge 1 commit into
hyprwm:mainfrom
martintrojer:hl-pam-backoff
Open

martintrojer wants to merge 1 commit into
hyprwm:mainfrom
martintrojer:hl-pam-backoff

Conversation

@martintrojer

@martintrojer martintrojer commented Oct 28, 2026 •

Copy link
Copy Markdown

If PAM fails without ever calling the conversation (pam_deny in the stack, pam_start failure, empty username) the auth thread retries in a tight loop. It spins a core and the fail counter/log grow by thousands per second. With no username it eventually segfaults.

Now it waits up to 1 s on the existing inputSubmittedCondition before retrying, so terminate() still wakes it (the #1059 deadlock fix is untouched). Empty username is a permanent failure: enqueue it once and stop.

pam_deny, ~3 s locked: 11990 failed attempts before, 4 after. SIGUSR1 to exit goes from 25 ms to ~117 ms on that stack. 340 lock+terminate runs, no hang. Normal prompting stack unchanged. Real build in an Arch container.

Related: #1069 waits on the same condvar in init(), probably a textual conflict.

@martintrojer
martintrojer marked this pull request as ready for review October 28, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant