[dm-crypt] cryptsetup problem with memory allocation

Belisko Marek marek.belisko at gmail.com
Mon Jun 23 10:50:15 CEST 2014


Hi,

I'm trying to use cryptsetup on beaglebone to encrypt some data.
cryptsetup version is 1.6.2. When running luksFormat (with verbose
option) I get following:

# Allocating crypt device /dev/loop0 context.
# Trying to open and read device /dev/loop0.
# Initialising device-mapper backend library.
# Timeout set to 0 miliseconds.
# Iteration time set to 1000 miliseconds.
# Interactive passphrase entry requested.
Enter passphrase:
Verify passphrase:
# Formatting device /dev/loop0 as type LUKS1.
# Crypto backend (gcrypt 1.5.0) initialized.
# Topology: IO (512/0), offset = 0; Required alignment is 1048576 bytes.
# Generating LUKS header version 1 using hash sha1, aes,
cbc-essiv:sha256, MK 32 bytes
# Crypto backend (gcrypt 1.5.0) initialized.
# KDF pbkdf2, hash sha1: 18204 iterations per second.
# Data offset 4096, UUID 9b15dba5-058d-4b81-aa14-e085698e87c1, digest
iterations 2125
# Updating LUKS header of size 1024 on device /dev/loop0
# Key length 32, device size 8192 sectors, header size 2050 sectors.
# Reading LUKS header of size 1024 from device /dev/loop0
# Key length 32, device size 8192 sectors, header size 2050 sectors.
# Adding new keyslot -1 using volume key.
# Calculating data for key slot 0
# Crypto backend (gcrypt 1.5.0) initialized.
# KDF pbkdf2, hash sha1: 18204 iterations per second.
# Key slot 0 use 8888 password iterations.
# Using hash sha1 for AF in key slot 0, 4000 stripes
# Updating key slot 0 [0x1000] area.
# Calculated device size is 250 sectors (RW), offset 8.
# Detected kernel Linux 3.9.0-g7897c55-dirty armv7l.
Couldn't create ioctl argument.
Cannot initialize device-mapper. Is dm_mod kernel module loaded?
# Releasing crypt device /dev/loop0 context.
# Releasing device-mapper backend.
# Unlocking memory.
Command failed with code 5: Cannot initialize device-mapper. Is dm_mod
kernel module loaded?

I track it down that malloc fails (ENONMEM) in libdevmapper and then
_dm_check_versions() fails when creating dm task (dmt =
dm_task_create(DM_DEVICE_LIST_VERSIONS). There is enough of free
memory in this case:

             total         used         free       shared      buffers
Mem:        247396        68656       178740            0            0

Any idea why allocation runs out of memory and due to that cryptsetup fails?

Thanks in advance.

BR,

marek


-- 
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com


More information about the dm-crypt mailing list