[Bug 1653523] [NEW] Input/Output Error when trying to --test-passphrase luksOpen
Daniel Grund
dfgrund at gmail.com
Mon Jan 2 15:13:33 UTC 2017
Public bug reported:
dfg at 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 at 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 at 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 at 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 at dfg-pc:~ # cryptsetup -v --test-passphrase luksOpen /home/dfg/data/crypt/business.luks testttt
Enter passphrase for /home/dfg/data/crypt/business.luks:
Command failed with code 5: Input/output error
root at 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 at 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 at dfg-pc:~ # cryptsetup -v --test-passphrase luksOpen /dev/disk/by-uuid/b36db545-6469-4498-bc04-39091560da8e testttt
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 at dfg-pc:~ # echo $?
0
More information via the following command
root at dfg-pc:~/tmp # strace -o strace.txt cryptsetup -v --test-passphrase luksOpen /home/dfg/data/crypt/business.luks testttt
Enter passphrase for /home/dfg/data/crypt/business.luks:
Command failed with code 5: Input/output error
root at 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
close(7) = 0
sendmsg(6, {msg_name(0)=NULL, msg_iov(1)=[{"[data]"..., 512}],
msg_controllen=64, [{cmsg_len=20, cmsg_level=SOL_ALG, cmsg_type=3},
{cmsg_len=40, cmsg_level=SOL_ALG, cmsg_type=2}], msg_flags=0}, 0) = -1
EINVAL (Invalid argument)
close(5) = 0
close(6) = 0
brk(0x202a000) = 0x202a000
munlockall() = 0
setpriority(PRIO_PROCESS, 0, 0) = 0
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "Command failed with code 5", 26) = 26
write(2, ": Input/output error\n", 21) = 21
exit_group(1) = ?
** Affects: cryptsetup (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to cryptsetup in Ubuntu.
https://bugs.launchpad.net/bugs/1653523
Title:
Input/Output Error when trying to --test-passphrase luksOpen
Status in cryptsetup package in Ubuntu:
New
Bug description:
dfg at 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 at 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 at 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 at 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 at dfg-pc:~ # cryptsetup -v --test-passphrase luksOpen /home/dfg/data/crypt/business.luks testttt
Enter passphrase for /home/dfg/data/crypt/business.luks:
Command failed with code 5: Input/output error
root at 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 at 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 at dfg-pc:~ # cryptsetup -v --test-passphrase luksOpen /dev/disk/by-uuid/b36db545-6469-4498-bc04-39091560da8e testttt
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 at dfg-pc:~ # echo $?
0
More information via the following command
root at dfg-pc:~/tmp # strace -o strace.txt cryptsetup -v --test-passphrase luksOpen /home/dfg/data/crypt/business.luks testttt
Enter passphrase for /home/dfg/data/crypt/business.luks:
Command failed with code 5: Input/output error
root at 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
close(7) = 0
sendmsg(6, {msg_name(0)=NULL, msg_iov(1)=[{"[data]"..., 512}],
msg_controllen=64, [{cmsg_len=20, cmsg_level=SOL_ALG, cmsg_type=3},
{cmsg_len=40, cmsg_level=SOL_ALG, cmsg_type=2}], msg_flags=0}, 0) = -1
EINVAL (Invalid argument)
close(5) = 0
close(6) = 0
brk(0x202a000) = 0x202a000
munlockall() = 0
setpriority(PRIO_PROCESS, 0, 0) = 0
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "Command failed with code 5", 26) = 26
write(2, ": Input/output error\n", 21) = 21
exit_group(1) = ?
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/1653523/+subscriptions
More information about the foundations-bugs
mailing list