Repository navigation
Conversation
…tions A single PAM conversation cannot host both methods: the stack is serialised by design (pam_fprintd(8) LIMITATIONS), so the password prompt starves the sensor. With the stock module the default 30s scan timeout falls through to pam_unix, the conversation stays alive waiting for a typed key, the QML sees pam.active and never re-arms the scan (touch stops working), and a password typed during the scan is stashed until the prompt finally arrives (up to 30s later). Split into two PamContexts started at arm time: - ryoku-lock: fingerprint only, pam_fprintd.so timeout=-1, so the scan lives for the whole lock; max-tries (3) still ends it on misreads and the shim re-arms after 1s - ryoku-lock-pw: password only, prompt pending from lock time, so a typed key answers immediately with no stash First Success unlocks and aborts the other (guarded against double fire); a wrong password shakes the field and re-prompts without disturbing the sensor conversation. Verified on v0.63.1-beta.19 with debug PAM logs (since removed): touch at 3s, touch still matching after 58s of scanning, password obtained in the same second as the lock. qmllint clean.
Collaborator
|
landed on unstable-dev as e2fe732 with one small addition (the sensor-win flag no longer rides the typed-key heuristic, since the fingerprint conversation never prompts). your analysis was spot on; thanks for the careful writeup and the PAM trace. it'll reach main with the next fast-forward. |
Contributor
Author
|
thanks for landing it. good call on the sensor-win flag — with the conversations split the typed-key heuristic had nothing left to detect, so the unconditional read is strictly better. picked that up locally already; will ride the next fast-forward to main. |
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.
What's wrong
The in-session lock screen supports fingerprint unlock (added in #48/#52 via
pam_fprintd_grosshack.so), but the PAM service and the shim run one singlePamContextfor both the sensor and the typed password. The PAM stack is serialised by design, so both methods end up fighting over the same conversation:Touch stops working after ~30 s.
pam_fprintd.so's default scan timeout is 30 s. When it expires the conversation falls through topam_unix, which opens a password prompt. The conversation is now alive but waiting for a typed key, soPamContext.activestays true and the shim's re-arm logic (rearmTimer→armFingerprint()) never fires. Touching the sensor does nothing until you type the password once (which ends the conversation and lets the next lock re-arm).A password typed during the scan is swallowed for up to 30 s. With no prompt open yet,
login()stashes the key inpendingPasswordand only feeds it when PAM asks — i.e. when the scan finally times out. From the user's point of view the unlock hangs, then the screen whites out late (a stuck stash that auto-submits).Why
From the
pam_fprintd(8)LIMITATIONS section:A single conversation cannot host a scan that lasts the whole lock and a password prompt that must be pending from t=0.
The fix
Split into two
PamContexts started at lock time, firstSuccesswins and aborts the other (guarded against double-fire):assets/pam/ryoku-lockpam_fprintd.so timeout=-1— scan lives for the whole lock;max-tries(3) still ends it on misreads, shim re-arms after 1 sassets/pam/ryoku-lock-pw(new)pam_unix.so nullok— prompt pending from t=0, a typed key answers immediately, no stashA wrong password shakes the field and re-prompts without disturbing the sensor conversation — the scan keeps running while the user retypes. The
debugflags used for diagnosis are already stripped.README.ryoku.mdis updated: the shim's divergence from upstream qylock is no longer "in one place".How it was tested
Arch, Ryoku v0.63.1-beta.19 (e76a32d), fprintd 1.94.5, Synaptics
06cb:00dfreader, ThinkPad. Journal evidence withdebugon both services (flags since removed):19:11:41 VerifyStart→19:11:44 verify-match19:12:02 VerifyStart→19:13:00 verify-matchWaiting for 9223372036854 s=timeout=-1), the case that used to fail19:13:11 pam_unix(ryoku-lock-pw:auth): username obtainedBefore this change the same three tests produced: case 1 ✅, case 2 ❌ (dead sensor), case 3⚠️ (auto-submit after 30 s).
qmllintis clean on the patched shim.The same root cause family as #237 (the polkit agent blocking on a pending prompt) — that one is system config, this one is the vendored lockscreen, hence the separate PR.