dm-crypt hangs on kernel 5.4.3

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

dm-crypt hangs on kernel 5.4.3

1,250 Views
kanimozhi_t
Contributor V

Hi all,

    I'm trying to implement root file system authentication with integritysetup from cryptsetup in i.MX 8mm Mini EVK.

For this I've added dm-crypt and Crypto user API in my kernel build as explained here: https://wiki.gentoo.org/wiki/Dm-crypt#Kernel_Configuration.

The user-space application is added as (in Yocto),

IMAGE_INSTALL += " cryptodev-module cryptsetup"

    However, when i try running cryptsetup in user-space, it hangs on device-mapper: reload ioctl on failed: Invalid argument.

So, can any one explain the reason or methods to fix run dm-crypt with cryptsetup in Yocto zeus (Linux Kernel 5.4)!

I've added detailed log for further reference.

NOTE: I've already successfully built this for kernel 4.19 with same configuration.

root@imx8mmevk:~# cryptsetup luksFormat /dev/mmcblk1p4
WARNING: Device /dev/mmcblk1p4 already contains a 'crypto_LUKS' superblock signature.

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

Are you sure? (Type uppercase yes): YES
Enter passphrase for /dev/mmcblk1p4:
Verify passphrase:
root@imx8mmevk:~# cryptsetup --debug luksOpen /dev/mmcblk1p4 crypt_home
# cryptsetup 2.2.1 processing "cryptsetup --debug luksOpen /dev/mmcblk1p4 crypt_home"
# Running command open.
# Locking memory.
# Installing SIGINT/SIGTERM handler.
# Unblocking interruption on signal.
# Allocating context for crypt device /dev/mmcblk1p4.
# Trying to open and read device /dev/mmcblk1p4 with direct-io.
# Initialising device-mapper backend library.
# Trying to load any crypt type from device /dev/mmcblk1p4.
# Crypto backend (OpenSSL 1.1.1d 10 Sep 2019) initialized in cryptsetup library version 2.2.1.
# Detected kernel Linux 5.4.3-2.0.0+gfd263a3edd95 aarch64.
# PBKDF pbkdf2-sha256, time_ms 2000 (iterations 0).
# Reading LUKS header of size 1024 from device /dev/mmcblk1p4
# Key length 64, device size 65536 sectors, header size 4036 sectors.
# Activating volume crypt_home using token -1.
# Interactive passphrase entry requested.
Enter passphrase for /dev/mmcblk1p4:
# Activating volume crypt_home [keyslot -1] using passphrase.
[ 75.517856] device-mapper: ioctl: 4.41.0-ioctl (2019-09-16) initialised: dm-devel@redhat.com
# dm version [ opencount flush ] [16384] (*1)
# dm versions [ opencount flush ] [16384] (*1)
# Detected dm-ioctl version 4.41.0.
# Device-mapper backend running with UDEV support enabled.
# dm status crypt_home [ opencount noflush ] [16384] (*1)
# Trying to open key slot 0 [ACTIVE_LAST].
# Reading key slot 0 area.
# Using userspace crypto wrapper to access keyslot area.
# Reusing open ro fd on device /dev/mmcblk1p4
# dm versions [ opencount flush ] [16384] (*1)
# dm status [ 77.620394] device-mapper: table: 253:0: crypt: unknown target type
crypt_home [ opencount noflush ][ 77.627278] device-mapper: ioctl: error adding target to table
[16384] (*1)
# Calculated device size is 61440 sectors (RW), offset 4096.
# dm versions [ opencount flush ] [16384] (*1)
# DM-UUID is CRYPT-LUKS1-5ed0055c2a4843c49a147f3d56a0b151-crypt_home
# Udev cookie 0xd4d9213 (semid 0) created
# Udev cookie 0xd4d9213 (semid 0) incremented to 1
# Udev cookie 0xd4d9213 (semid 0) incremented to 2
# Udev cookie 0xd4d9213 (semid 0) assigned to CREATE task(0) with flags DISABLE_LIBRARY_FALLBACK (0x20)
# dm create crypt_home CRYPT-LUKS1-5ed0055c2a4843c49a147f3d56a0b151-crypt_home [ opencount flush ] [16384] (*1)
# dm reload crypt_home [ opencount flush securedata ] [16384] (*1)
device-mapper: reload ioctl on failed: Invalid argument
# Udev cookie 0xd4d9213 (semid 0) decremented to 1
# Udev cookie 0xd4d9213 (semid 0) incremented to 2
# Udev cookie 0xd4d9213 (semid 0) assigned to REMOVE task(2) with flags DISABLE_LIBRARY_FALLBACK (0x20)
# dm remove crypt_home [ opencount flush securedata ] [16384] (*1)
# Udev cookie 0xd4d9213 (semid 0) decremented to 1
# Udev cookie 0xd4d9213 (semid 0) waiting for zero

 

0 Kudos
0 Replies