Public bug reported:
dfg@dfg-pc:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:Ubuntu 16.04.1 LTS
Release:16.04
Codename: xenial
dfg@dfg-pc:~ $ uname -a
Linux dfg-pc 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 x86_64
x86_64 x86_64 GNU/Linux
dfg@dfg-pc:~ $ apt-cache policy cryptsetup
cryptsetup:
Installed: 2:1.6.6-5ubuntu2
Candidate: 2:1.6.6-5ubuntu2
Version table:
*** 2:1.6.6-5ubuntu2 500
500 http://de.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
100 /var/lib/dpkg/status
root@dfg-pc:~ # ls -lh /home/dfg/data/crypt/business.luks
-rw--- 1 dfg dfg 5.0G Dec 25 12:08 /home/dfg/data/crypt/business.luks
root@dfg-pc:~ # cryptsetup -v --test-passphrase luksOpen
/home/dfg/data/crypt/business.luks tes
Enter passphrase for /home/dfg/data/crypt/business.luks:
Command failed with code 5: Input/output error
root@dfg-pc:~ # echo $?
1
Observed behavior: Cryptsetup terminates after 1st passphrase entry. It does
not prompt for a second try.
Expected behavior: Cryptsetup accepts provided passphrase or prompts for 2nd
try.
root@dfg-pc:~ # cryptsetup -v luksDump /home/dfg/data/crypt/business.luks
LUKS header information for /home/dfg/data/crypt/business.luks
Version:1
Cipher name:aes
Cipher mode:ecb-plain64
Hash spec: ripemd160
Payload offset: 2048
MK bits:128
MK digest: [...removed for posting...]
MK salt:[...removed for posting...]
[...removed for posting...]
MK iterations: 35250
UUID: [...removed for posting...]
Key Slot 0: ENABLED
Iterations: 140659
Salt: [...removed for posting...]
[...removed for posting...]
Key material offset:8
AF stripes: 4000
Key Slot 1: DISABLED
Key Slot 2: DISABLED
Key Slot 3: DISABLED
Key Slot 4: DISABLED
Key Slot 5: DISABLED
Key Slot 6: DISABLED
Key Slot 7: DISABLED
Command successful.
The overall context/system is:
a) Issue possibly related to release upgrade from 14.04(.1?) to 16.04.1. Worked
before upgrade. Not sure if it ever worked after the upgrade. However, I
performed the upgrade only some days ago.
b) /home/dfg/data/crypt/business.luks is located on a device that itself
has been (successfully) mounted with cryptmount.
c) For this device things work as expected:
root@dfg-pc:~ # cryptsetup -v --test-passphrase luksOpen
/dev/disk/by-uuid/b36db545-6469-4498-bc04-39091560da8e tes
Enter passphrase for /dev/disk/by-uuid/b36db545-6469-4498-bc04-39091560da8e:
[entered wrong pass]
No key available with this passphrase.
Enter passphrase for /dev/disk/by-uuid/b36db545-6469-4498-bc04-39091560da8e:
[entered wrong pass]
No key available with this passphrase.
Enter passphrase for /dev/disk/by-uuid/b36db545-6469-4498-bc04-39091560da8e:
Key slot 0 unlocked.
Command successful.
root@dfg-pc:~ # echo $?
0
More information via the following command
root@dfg-pc:~/tmp # strace -o strace.txt cryptsetup -v --test-passphrase
luksOpen /home/dfg/data/crypt/business.luks tes
Enter passphrase for /home/dfg/data/crypt/business.luks:
Command failed with code 5: Input/output error
root@dfg-pc:~/tmp # echo $?
1
yields
open("/dev/tty", O_RDWR)= 5
ioctl(5, TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(5, "Enter passphrase for /home/dfg/d"..., 57) = 57
ioctl(5, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(5, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost isig icanon -echo ...})
= 0
ioctl(5, TCGETS, {B38400 opost isig icanon -echo ...}) = 0
read(5, "[the correct passphrase]\n", 512) = [length of passphrase]
ioctl(5, TCGETS, {B38400 opost isig icanon -echo ...}) = 0
ioctl(5, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost isig icanon echo ...}) = 0
ioctl(5, TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(5, "\n", 1) = 1
close(5)= 0
socket(PF_ALG, SOCK_SEQPACKET, 0) = 5
bind(5, {sa_family=AF_ALG, sa_data="skcipher\0\0\0\0\0\0"}, 88) = 0
accept(5, NULL, NULL) = 6
setsockopt(5, SOL_ALG, 1, "\244\304\304@\332\0259+\340\220\324\214:\347\f\270",
16) = 0
open("/home/dfg/data/crypt/business.luks", O_RDONLY) = 7
fstat(7, {st_mode=S_IFREG|0600, st_size=5368709120, ...}) = 0
close(7)= 0
open("/home/dfg/data/crypt/business.luks", O_RDONLY|O_SYNC|O_DIRECT) = 7
lseek(7, 4096, SEEK_SET)= 4096
fstatfs(7, {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=480681698,
f_bfree=243745114, f_bavail=243741018, f_files=122101760, f_ffree=121595047,
f_fsid={-525068978, -1338436839}, f_namelen=255, f_frsize=4096, f_flags=3110})
= 0
brk(0x204a000) = 0x204a000
brk(0x2049000) = 0x2049000
read(7, "[data]"..., 61440) = 61440
read(7, "[data]"..., 4096) = 4096
brk(0x2039000) = 0x2039000
c