Skip to content

fix(crypt): standardise password retry behaviour with rd.luks.tries - #2344

Draft
nadzyah wants to merge 1 commit into
dracut-ng:mainfrom
nadzyah:fix-systemd-cryptsetup-wrong-pass
Draft

fix(crypt): standardise password retry behaviour with rd.luks.tries#2344
nadzyah wants to merge 1 commit into
dracut-ng:mainfrom
nadzyah:fix-systemd-cryptsetup-wrong-pass

Conversation

@nadzyah

@nadzyah nadzyah commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Without an explicit tries= in the crypttab entry, systemd-cryptsetup uses its default of 3 attempts and then gives up, causing dracut-initqueue to hang silently before dropping to an emergency shell.

Set tries=0 across all paths that generate crypttab entries in the initrd. Entries that already specify tries= are left unchanged.

Add a test to TEST-41-FULL-SYSTEMD that sends three wrong passwords, then the correct one, verifying the system unlocks successfully.

The bug was originally reported on Launchpad: https://bugs.launchpad.net/ubuntu/+source/dracut/+bug/2146686

Checklist

  • I have tested it locally
  • I have reviewed and updated any documentation if relevant - not needed
  • I am providing new code and test(s) for it - a bugfix with a test

@nadzyah
nadzyah requested a review from a team as a code owner April 1, 2026 15:22
@github-actions github-actions Bot added test Issues related to testing modules Issue tracker for all modules crypt Issues related to the crypt module labels Apr 1, 2026
@nadzyah
nadzyah force-pushed the fix-systemd-cryptsetup-wrong-pass branch from b8700a0 to 39a4e2d Compare April 1, 2026 15:23
Comment thread modules.d/70crypt/crypt-run-generator.sh Outdated
@nadzyah
nadzyah force-pushed the fix-systemd-cryptsetup-wrong-pass branch 4 times, most recently from e802fdf to edda796 Compare April 2, 2026 21:24
@nadzyah
nadzyah force-pushed the fix-systemd-cryptsetup-wrong-pass branch 2 times, most recently from af4d5bf to a117d47 Compare April 13, 2026 17:27
@nadzyah nadzyah changed the title fix(crypt): set tries=0 in initrd crypttab to allow unlimited password retries fix(crypt): standardise password retry behaviour with rd.luks.tries Apr 13, 2026
@nadzyah
nadzyah force-pushed the fix-systemd-cryptsetup-wrong-pass branch 3 times, most recently from bbe3ce5 to 69bf6b9 Compare April 15, 2026 14:34
Comment thread modules.d/70crypt-lib/crypt-lib.sh Outdated
Comment thread modules.d/70crypt-lib/crypt-lib.sh Outdated
@nadzyah
nadzyah force-pushed the fix-systemd-cryptsetup-wrong-pass branch from 69bf6b9 to 73fb3e5 Compare April 16, 2026 09:12
Comment thread modules.d/70crypt-lib/crypt-lib.sh
@nadzyah
nadzyah force-pushed the fix-systemd-cryptsetup-wrong-pass branch 2 times, most recently from a9b80ba to c301dc4 Compare April 16, 2026 16:06

@bdrung bdrung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rd.luks.tries should be documented in the man page.

Comment thread modules.d/70crypt-lib/crypt-lib.sh Outdated
Comment thread modules.d/70crypt/crypt-generator.sh
@nadzyah
nadzyah force-pushed the fix-systemd-cryptsetup-wrong-pass branch from c301dc4 to 342cf4a Compare April 17, 2026 19:38
Comment thread modules.d/70crypt-lib/crypt-lib.sh Fixed
@nadzyah
nadzyah force-pushed the fix-systemd-cryptsetup-wrong-pass branch from 342cf4a to e789dab Compare April 17, 2026 19:41
@nadzyah
nadzyah requested a review from bdrung April 20, 2026 14:38
Without an explicit tries= in crypttab, systemd-cryptsetup defaults to three
attempts and gives up, causing dracut-initqueue to hang before reaching the
emergency shell.

Standardise retries via rd.luks.options=tries=N (default 0, meaning unlimited)
across the generator drop-in, rd.auto, luks_open_interactive, and the hostonly
crypttab copy.

Add a TEST-41-FULL-SYSTEMD test that sends three wrong passwords then the
correct one.

Bug-Ubuntu: https://launchpad.net/bugs/2146686
@bdrung

bdrung commented May 7, 2026

Copy link
Copy Markdown
Member

Created systemd/systemd#41984 to address the systemd-cryptsetup default in the tool itself.

@devkontrol

Copy link
Copy Markdown
Collaborator

Merge conflict, marking it draft for now.

@devkontrol
devkontrol marked this pull request as draft August 10, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crypt Issues related to the crypt module crypt-lib docs man modules Issue tracker for all modules test Issues related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants