Bug 1085562 - dracut is unable to read crypttab if last line does not contain a newline
Summary: dracut is unable to read crypttab if last line does not contain a newline
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: dracut
Version: 6.5
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: dracut-maint-list
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-08 23:05 UTC by Kevin Young
Modified: 2015-08-31 16:48 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: If /etc/crypttab does not contain a newline as the last character, the last line is not parsed by dracut. Consequence: The encrypted disk is not unlocked. Fix: dracut was fixed to handle /etc/crypttab without a newline at the end. Result: The encrypted disk specified in the last line is handled, a password is requested and the disk is unlocked.
Clone Of:
Environment:
Last Closed: 2015-07-22 06:38:00 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1328 normal SHIPPED_LIVE dracut bug fix and enhancement update 2015-07-20 17:53:04 UTC

Description Kevin Young 2014-04-08 23:05:17 UTC
Description of problem:
When booting to an encrypted root volume and the crypttab has been included in the initramfs.img, if the line in the crypttab file does not end in a newline, it is not properly interpreted by dracut. It would be preferable that dracut give a better error message if it cannot read the crypttab file properly. The error during boot looks like this:

Version-Release number of selected component (if applicable):
dracut-004-336.el6_5.2

How reproducible:
Every time.

Steps to Reproduce:
1. Create crypttab file that contains "cryptroot /dev/xvdf /etc/keyfile" (ensure entry in crypttab does not end in a newline)
2. Run dracut, injecting crypttab and keyfile into initramfs.img
3. update grub.conf to boot to encrypted filesystem root=/dev/mapper/cryptroot

Actual results:
dracut: luksOpen /dev/xvdf luks-587e17f6-c6a6-447e-bd9e-e654e7aaedae /etc/keyfile
dracut Warning: No root device "block:/dev/mapper/cryptroot" found

Expected results:
dracut: luksOpen /dev/xvdf cryptroot /etc/keyfile
dracut: Mounted root filesystem /dev/mapper/cryptroot

Additional info:

Comment 1 Adam Williamson 2014-04-17 17:26:13 UTC
This is filed against Fedora Rawhide, but:

Version-Release number of selected component (if applicable):
dracut-004-336.el6_5.2

is this supposed to be for RHEL 6 or Fedora? Thanks!

Comment 5 Alexander Todorov 2015-04-02 11:24:39 UTC
I wasn't able to reproduce with dracut-004-356.el6.noarch and my /etc/crypptab doesn't contain a new line at the end.


Kevin,
can you see if you can reproduce with RHEL 6.6 ?

Comment 8 errata-xmlrpc 2015-07-22 06:38:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1328.html

Comment 9 Kevin Young 2015-08-31 16:48:40 UTC
verified the fix


Note You need to log in before you can comment on or make changes to this bug.