Repository navigation
Stop boots from freezing after a correct disk password - #20909
Merged
Merged
Conversation
Contributor
[Medium impact] The PR appears safe to merge; no new actionable issues remain. SummaryPrevents the disk-unlock answer from being cut short by a timed read.
No new actionable issues found. This review checked source code; it did not run tests.
|
`plymouth ask-for-password` reads the unlock's answer from a pipe with a one-second limit. The initramfs's busybox 1.36.1 drops what it has read when that limit runs out, so an answer that arrives at that moment loses its request number. The rest of it matches no request, and the boot waits forever with the bar at 65%. Put one byte in front of the answer and time only that byte, then read the rest without a limit. A single byte cannot be cut short. With the real scripts under that busybox, and answers 0.97 to 1.00 s into the wait, 120 of 2,400 were lost before and none of 2,400 now. An unlock returns in 2.4 ms, against 2.6 ms.
emirb
force-pushed
the
fix/splash-lost-answer
branch
from
November 30, 2026 12:38
651ab11 to
67c0c9b
Compare
cursor Bot
pushed a commit
to mark-groves/omarchy
that referenced
this pull request
Nov 30, 2026
`plymouth ask-for-password` reads the unlock's answer from a pipe with a one-second limit. The initramfs's busybox 1.36.1 drops what it has read when that limit runs out, so an answer that arrives at that moment loses its request number. The rest of it matches no request, and the boot waits forever with the bar at 65%. Put one byte in front of the answer and time only that byte, then read the rest without a limit. A single byte cannot be cut short. With the real scripts under that busybox, and answers 0.97 to 1.00 s into the wait, 120 of 2,400 were lost before and none of 2,400 now. An unlock returns in 2.4 ms, against 2.6 ms.
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 changes
A boot can freeze after a correct disk password. The splash stays up with the bar at 65%, and nothing but a power cycle gets out. CI hit it three times on 30 November, on x86_64 and aarch64 (for example run 46405938465). It comes with the new boot splash (#20404), which 4.6.0-rc1 does not have.
plymouth ask-for-passwordreads the unlock's answer from a pipe with a one-second limit. The initramfs's busybox 1.36.1 drops what it has read when that limit runs out. An answer that arrives at that moment loses its request number. The rest matches no request, so the boot waits forever.answernow puts one byte in front of the answer.ask-for-passwordreads only that byte with the limit, then reads the rest without one. A single byte cannot be cut short. Writing the answer to a file was ruled out: it needed more code, and the writer could then block on the pipe.Verification
The real scripts ran under that busybox, with answers 0.97 to 1.00 s into the wait. Before, 120 of 2,400 answers were lost. Now none of 2,400 are. With a 0.4 s unlock, none of 400 were lost either way. An unlock returns in 2.4 ms, against 2.6 ms.
In a VM with encrypted 4.6.0rc2, 6 of 6 boots with the change came up: two normal, two after a wrong password, and two with Escape first.
One VM boot without the change froze with a logger in its initramfs.
cryptsetuphad ended, andask-for-passwordstill waited for its answer.test/shell.d/boot-splash-answer-test.shis new. It fails without the change and passes with it.Not verified: real hardware, and that all three CI freezes have this cause. Those runs have no log from the initramfs.
Screenshots
The frozen boot in CI. Every capture from 78 s to 189 s is the same: