logfs: kernel NULL dereference
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Forwarded to dm-devel. Problem is a NULL pointer dereference in kcryptd_io_read, which is triggered when mounting logfs. If someone with device mapper knowledge could have a look, that would be useful.
Quoted 33 lines · Jörn Engel
Ok, I can reliably reproduce the problem with the following, based on your description:
truncate -s 0 foo
truncate -s 1G foo
losetup -v -f foo
cryptsetup luksFormat/dev/loop0cryptsetup luksOpen/dev/loop0foo pvcreate/dev/mapper/foo
vgcreateour_volume/dev/mapper/foolvcreate -L 128M -n logfstestour_volumeyes yes | mklogfs/dev/mapper/our_volume-logfstestmount/dev/mapper/our_volume-logfstest/mnt/It is a bit annoying that cryptsetup cannot easily be scripted. Oh well! Problem is indeed with the memcpy, except that
bio_iovec(base_bio)is NULL, notclone->bi_io_vec. I have added this line in a bunch of places to get a better idea.printk("%p %p %p %s\n", bio, bio->bi_io_vec, bio_iovec(bio), __func__);
ffff88023424fc18ffff88023424fca8ffff88023424fca8sync_requestffff88023424fc18ffff88023424fca8ffff88023424fca8dm_requestffff88023424fc18ffff88023424fca8ffff88023424fca8_dm_requestffff88023424fc18ffff88023424fca8ffff88023424fca8__split_and_process_bioffff880235a10d40 (null) (null) __map_bio ffff880235a10d40 (null) (null) dm_request ffff880235a10d40 (null) (null) _dm_request ffff880235a10d40 (null) (null) __split_and_process_bio ffff880235368780 (null) (null) __map_bio ffff880235368780 (null) (null) crypt_map ffff880235368780 (null) (null) kcryptd_io_read
Quoted 12 lines
So
__split_and_process_biocreates two new bios, both of which lack abi_io_vecmember and one of which gets passed tokcryptd_io_readeventually. Ho hum.My understanding of device mapper is not good enough yet to understand what is really going on here.
Jörn
Signature · 2 lines
One of my most productive days was throwing away 1000 lines of code. -- Ken Thompson.
Jörn
Signature · 10 lines
In America you can have either a flimsy box banged together out of two by fours and drywall, or a McMansion -- a flimsy box banged together out of two by fours and drywall, but larger, more dramatic-looking, and full of expensive fittings. -- Paul Graham -- dm-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/dm-devel
Quoted 4 lines · Jörn Engel
Forwarded to dm-devel. Problem is a NULL pointer dereference in
kcryptd_io_read, which is triggered when mounting logfs. If someone with device mapper knowledge could have a look, that would be useful.
Quoted 16 lines
Quoted 15 lines · Jörn Engel
Ok, I can reliably reproduce the problem with the following, based on your description:
truncate -s 0 foo
truncate -s 1G foo
losetup -v -f foo
cryptsetup luksFormat/dev/loop0cryptsetup luksOpen/dev/loop0foo pvcreate/dev/mapper/foo
vgcreateour_volume/dev/mapper/foolvcreate -L 128M -n logfstestour_volumeyes yes | mklogfs/dev/mapper/our_volume-logfstestmount/dev/mapper/our_volume-logfstest/mnt/
I think this can be minimized to
echo secret > keyfile
truncate -s 0 foo
truncate -s 1G foo
losetup -v -f foo
cryptsetup luksFormat /dev/loop0 ./keyfile cryptsetup --key-file ./keyfile luksOpen /dev/loop0 bar yes yes | mklogfs /dev/mapper/bar
mount /dev/mapper/bar /mnt/
Quoted 1 line
Quoted 1 line
It is a bit annoying that cryptsetup cannot easily be scripted.
Look above.
Rest of crypto behaviour is rather strange.
Signature · 2 lines
Witold Baryluk JID: witold.baryluk // jabster.pl
Quoted 4 lines · Jörn Engel
Forwarded to dm-devel. Problem is a NULL pointer dereference in
kcryptd_io_read, which is triggered when mounting logfs. If someone with device mapper knowledge could have a look, that would be useful.
Quoted 15 lines
Quoted 14 lines · Jörn Engel
Ok, I can reliably reproduce the problem with the following, based on your description:
truncate -s 0 foo
truncate -s 1G foo
losetup -v -f foo
cryptsetup luksFormat/dev/loop0cryptsetup luksOpen/dev/loop0foo pvcreate/dev/mapper/foo
vgcreateour_volume/dev/mapper/foolvcreate -L 128M -n logfstestour_volumeyes yes | mklogfs/dev/mapper/our_volume-logfstestmount/dev/mapper/our_volume-logfstest/mnt/
Which kernel version are you using?
Quoted 1 line
Quoted 1 line
It is a bit annoying that cryptsetup cannot easily be scripted.
It can be easily scripted. (In quiet mode it will not ask for YES response, add -q, or just do "echo -n $PASSWORD | cryptsetup luksFormat ...")
Milan
--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel
Quoted 21 lines · Milan Broz
Quoted 4 lines · Jörn Engel
Forwarded to dm-devel. Problem is a NULL pointer dereference in
kcryptd_io_read, which is triggered when mounting logfs. If someone with device mapper knowledge could have a look, that would be useful.Quoted 15 lines
Quoted 14 lines · Jörn Engel
Ok, I can reliably reproduce the problem with the following, based on your description:
truncate -s 0 foo
truncate -s 1G foo
losetup -v -f foo
cryptsetup luksFormat/dev/loop0cryptsetup luksOpen/dev/loop0foo pvcreate/dev/mapper/foo
vgcreateour_volume/dev/mapper/foolvcreate -L 128M -n logfstestour_volumeyes yes | mklogfs/dev/mapper/our_volume-logfstestmount/dev/mapper/our_volume-logfstest/mnt/
Quoted 1 line
Which kernel version are you using?
Latest git - well, close to latest, given the current kernel.org trouble.
Quoted 4 lines
Quoted 1 line
Quoted 1 line
It is a bit annoying that cryptsetup cannot easily be scripted.
It can be easily scripted. (In quiet mode it will not ask for YES response, add -q, or just do "echo -n $PASSWORD | cryptsetup luksFormat ...")
Ok, I'll use that in the future. Thanks.
Jörn
Signature · 9 lines
More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason - including blind stupidity. -- W. A. Wulf -- dm-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/dm-devel