cryptsetup open hangs waiting for udev cookied
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cryptsetup (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
lvm2 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
systemd (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
systemd has a testcase to setup, open and close a luks1 volume.
this test case has started to fail with udev 237 & cryptsetup2
this appears to be reproducible with straight up "cryptsetup open" call which seems to hang in device mapper library, e.g.:
# cryptsetup open --type luks UUID=fd41c9ba-
# cryptsetup 2.0.1 processing "cryptsetup open --type luks UUID=fd41c9ba-
# Running command open.
# Locking memory.
# Installing SIGINT/SIGTERM handler.
# Unblocking interruption on signal.
# Allocating context for crypt device /dev/disk/
# Trying to open and read device /dev/disk/
# Initialising device-mapper backend library.
# Trying to load any crypt type from device /dev/disk/
# Crypto backend (gcrypt 1.8.1) initialized in cryptsetup library version 2.0.1.
# Detected kernel Linux 4.13.0-32-generic x86_64.
# PBKDF pbkdf2, hash sha256, time_ms 2000 (iterations 0), max_memory_kb 0, parallel_threads 0.
# Reading LUKS header of size 1024 from device /dev/disk/
# Key length 32, device size 18432 sectors, header size 2050 sectors.
# Activating volume varcrypt using token -1.
# File descriptor passphrase entry requested.
# Activating volume varcrypt [keyslot -1] using passphrase.
# dm version [ opencount flush ] [16384] (*1)
# dm versions [ opencount flush ] [16384] (*1)
# Detected dm-ioctl version 4.37.0.
# Detected dm-crypt version 1.18.0.
# Device-mapper backend running with UDEV support enabled.
# dm status varcrypt [ opencount flush ] [16384] (*1)
# Trying to open key slot 0 [ACTIVE_LAST].
# Reading key slot 0 area.
# Using userspace crypto wrapper to access keyslot area.
Key slot 0 unlocked.
# Calculated device size is 14336 sectors (RW), offset 4096.
# DM-UUID is CRYPT-LUKS1-
# Udev cookie 0xd4d4a7f (semid 65538) created
# Udev cookie 0xd4d4a7f (semid 65538) incremented to 1
# Udev cookie 0xd4d4a7f (semid 65538) incremented to 2
# Udev cookie 0xd4d4a7f (semid 65538) assigned to CREATE task(0) with flags DISABLE_
# dm create varcrypt CRYPT-LUKS1-
# dm reload varcrypt [ opencount flush securedata ] [16384] (*1)
# dm resume varcrypt [ opencount flush securedata ] [16384] (*1)
# varcrypt: Stacking NODE_ADD (253,0) 0:6 0660 [trust_udev]
# varcrypt: Stacking NODE_READ_AHEAD 256 (flags=1)
# Udev cookie 0xd4d4a7f (semid 65538) decremented to 1
# Udev cookie 0xd4d4a7f (semid 65538) waiting for zero
So i've tried various combinations of downgrading systemd/ cryptsetup/ lvm.
At the moment latest cryptsetup2 and systemd from bionic-proposed, pass the systemd test when downgrading lvm2 (devmapper et al) to the one in artful 2.02.168-2ubuntu3
I am suspecting a regression in lvm2, specifically around udev cookies synchronisation.