Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 181503 - sys-fs/cryptsetup-luks-1.0.4-r3 dm-crypt-start.sh - swap vs luks header check
Summary: sys-fs/cryptsetup-luks-1.0.4-r3 dm-crypt-start.sh - swap vs luks header check
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor
Assignee: Benjamin Smee (strerror) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-09 23:29 UTC by Johannes Krause
Modified: 2007-10-02 15:47 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Krause 2007-06-09 23:29:55 UTC
/lib/rcscripts/addons/dm-crypt-start.sh checks for a luks header (line 43) even when the target is swap. this leads to an exhaustive read on /dev/urandom for the password.
imho it should abort with an error when a luks header is detected on a swap target, because there could be important data in danger.
Comment 1 A Middleton 2007-07-13 07:32:52 UTC
I can verify this bug and have encountered it for nearly a year. <a href="http://www.mail-archive.com/gentoo-amd64@lists.gentoo.org/msg06122.html">Mailing list</a> and forums were no help and I suspected it was due to inadequate amd64 testing (I had unmasked the package manually) until recently.
Comment 2 Benjamin Smee (strerror) (RETIRED) gentoo-dev 2007-08-14 21:39:21 UTC
i'm not quite sure that i understand your concern. If someone has the wrong things in /etc/conf.d/dmcrypt (was cryptfs) then it can lead to an exhaustive read on /dev/urandom. I guess it's not ideal but surely the obvious thing should be put the right thing in the configuration file and you don't have an issue.

A.middleton: I don't think this bug is what you've been experiencing at least nothing in that thread seems relevant.
Comment 3 Johannes Krause 2007-08-15 22:24:19 UTC
Sorry for the bad formulation. 
When people want to reuse an existing volume for swap, and the volume contains a luks header, they will likely encounter the exhaustive read, because most people don't think of erasing the header in that case. They simply don't know that the script assumes there is no luks header in the swap use case, and it's not that easy to figure out what the problem is in that situation. At least I had to read the script to understand what was wrong.
A simple solution would be to ignore the header in the swap use case, but I don't think this would be a good idea, for the same reason mkfs.xfs checks for an existing filesystem. In an ideal world the script would not only check for a luks header but also for an existing filesystem before overwriting, however this may be overkill.
Comment 4 Benjamin Smee (strerror) (RETIRED) gentoo-dev 2007-10-02 15:47:59 UTC
i've ammended the script, try 1.0.5-r1 let me know how you find it. thanks for reporting