Bug 1098714 - cryptsetup luksFormat fails for non-root user
Summary: cryptsetup luksFormat fails for non-root user
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: cryptsetup
Version: 20
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Milan Broz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-17 15:13 UTC by Steeve McCauley
Modified: 2014-05-18 13:58 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-05-17 20:05:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Steeve McCauley 2014-05-17 15:13:11 UTC
Description of problem:

Attempting to format a luks file-based container on a loopback device fails

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. dd if=/dev/urandom of=./vol00 bs=1M count=50
2. losetup -f ./vol00
3. cryptsetup --verbose --verify-passphrase luksFormat /dev/loop0

Actual results:

$ cryptsetup --verbose --verify-passphrase luksFormat /dev/loop0

WARNING!
========
This will overwrite data on /dev/loop0 irrevocably.

Are you sure? (Type uppercase yes): YES
Enter passphrase: 
Verify passphrase: 
Cannot initialize device-mapper, running as non-root user.
Command failed with code 5: Cannot initialize device-mapper, running as non-root user.


Expected results:

Expected cryptsetup luksFormat to succeed, and allow a subsequent call to luksOpen.

Additional info:

I also had to tweak some permissions to get the loopback devices to load, as shown in Bug #1019440 and #1045432.

Comment 1 Steeve McCauley 2014-05-17 15:19:56 UTC
I attempted to change some permissions in /dev/mapper/ to chgrp from root to disk, as well as chmod g+rwx.

Kernel is,

Linux zorg 3.14.3-200.fc20.x86_64 #1 SMP Tue May 6 19:00:18 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Comment 2 Milan Broz 2014-05-17 20:05:28 UTC
Unfortunately, kernel device-mapper (including dm-crypt) requires root privilege to operate.

It is long term issue to allow operation for non-user. But please ask kernel device-mapper developers.

Cryptsetup cannot do anything here, both format and activate require dmcrypt device creation, allowing access to block device is not enough.

Comment 3 Steeve McCauley 2014-05-18 13:58:22 UTC
Aw damn, really.  Sorry, I could have sworn I'd done this in the past.  I'll go nag the device-mapper guys.


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