Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 468158

Summary: sys-fs/cryptsetup fails to use device-mapper with dev-libs/libgcrypt[caps]
Product: Gentoo Linux Reporter: Doug Goldstein (RETIRED) <cardoe>
Component: EclassesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: aidecoe, bertrand, bugs+gentoo, da_risk, eva, gentoo, graham, me, tetromino, uzytkownik2
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=467798
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 468616    

Description Doug Goldstein (RETIRED) gentoo-dev 2013-05-01 15:39:36 UTC
When dev-libs/libgcrypt is built with USE=caps, sys-fs/cryptsetup will fail in the following way:

fd = open("/dev/mapper/control", ...);
-EACCES = ioctl(fd, DM_VERSION, ...)

Resulting in a message telling you dm_mod isn't loaded or isn't initialized yet. -EACCES is returned from the ioctl() if the calling process doesn't have CAP_SYS_ADMIN. ref: http://lxr.linux.no/#linux+v3.8.10/drivers/md/dm-ioctl.c#L1662

We likely should require libgcrypt to be built without USE=caps
Comment 1 Stefan Briesenick (RETIRED) gentoo-dev 2013-05-01 21:42:11 UTC
wuahhh, *THIS* stopped my fully encrypted server to boot. :-/

thanks for reporting!

I guess, the importance of this bug should be higher!
Comment 2 Alon Bar-Lev (RETIRED) gentoo-dev 2013-05-04 21:28:08 UTC
*** Bug 467798 has been marked as a duplicate of this bug. ***
Comment 3 Gilles Dartiguelongue (RETIRED) gentoo-dev 2013-05-13 09:19:01 UTC
Is there something to check/test, I just spent an hour trying to figure this out on my workstation :(
Comment 4 Frédéric Barthelery 2013-06-01 11:38:15 UTC
Ijust work on this when I tried to set up cryptsetup on my laptop.Steps to reproduce the bug are : 
 * emerge libgcrypt with USE=caps enabled
 * emerge cryptsetup
 * (optinally create a loop file device or use a diskpartition)
    dd if=/dev/null of=/tmp/file bs=1048576 seek=1024
    losetup /dev/loop0 /tmp/file
 * cryptsetup luksFormat /dev/loop0 (or /dev/sd??)
 * open the secure container
   cryptsetup open --type luks /dev/loop0 secure

The latest command failed.
Also see this bug report for additional info
http://code.google.com/p/cryptsetup/issues/detail?id=47
Comment 5 Tim Harder gentoo-dev 2013-08-14 04:48:54 UTC
This isn't an issue anymore since the caps use flag was removed from libgcrypt.