* Re: logfs: kernel NULL dereference
[not found] ` <20110914182425.GD24351@logfs.org>
@ 2011-09-14 18:34 ` Jörn Engel
2011-09-14 19:01 ` Witold Baryluk
2011-09-15 14:27 ` Milan Broz
0 siblings, 2 replies; 4+ messages in thread
From: Jörn Engel @ 2011-09-14 18:34 UTC (permalink / raw)
To: dm-devel; +Cc: Witold Baryluk, Prasad Joshi, Aniket Sane
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.
On Wed, 14 September 2011 20:24:25 +0200, Jörn Engel wrote:
>
> 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/loop0
> cryptsetup luksOpen /dev/loop0 foo
> pvcreate /dev/mapper/foo
> vgcreate our_volume /dev/mapper/foo
> lvcreate -L 128M -n logfstest our_volume
> yes yes | mklogfs /dev/mapper/our_volume-logfstest
> mount /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, not clone->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__);
>
> ffff88023424fc18 ffff88023424fca8 ffff88023424fca8 sync_request
> ffff88023424fc18 ffff88023424fca8 ffff88023424fca8 dm_request
> ffff88023424fc18 ffff88023424fca8 ffff88023424fca8 _dm_request
> ffff88023424fc18 ffff88023424fca8 ffff88023424fca8 __split_and_process_bio
> ffff880235a10d40 (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
>
> So __split_and_process_bio creates two new bios, both of which lack a
> bi_io_vec member and one of which gets passed to kcryptd_io_read
> eventually. Ho hum.
>
> My understanding of device mapper is not good enough yet to understand
> what is really going on here.
>
> Jörn
>
> --
> One of my most productive days was throwing away 1000 lines of code.
> -- Ken Thompson.
Jörn
--
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
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: logfs: kernel NULL dereference
2011-09-14 18:34 ` logfs: kernel NULL dereference Jörn Engel
@ 2011-09-14 19:01 ` Witold Baryluk
2011-09-15 14:27 ` Milan Broz
1 sibling, 0 replies; 4+ messages in thread
From: Witold Baryluk @ 2011-09-14 19:01 UTC (permalink / raw)
To: Jörn Engel; +Cc: dm-devel, Prasad Joshi, Aniket Sane
[-- Attachment #1.1: Type: text/plain, Size: 1279 bytes --]
On 09-14 20:34, Jörn Engel wrote:
> 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.
>
> On Wed, 14 September 2011 20:24:25 +0200, Jörn Engel wrote:
> >
> > 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/loop0
> > cryptsetup luksOpen /dev/loop0 foo
> > pvcreate /dev/mapper/foo
> > vgcreate our_volume /dev/mapper/foo
> > lvcreate -L 128M -n logfstest our_volume
> > yes yes | mklogfs /dev/mapper/our_volume-logfstest
> > mount /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/
> > It is a bit annoying that cryptsetup cannot easily be scripted.
Look above.
Rest of crypto behaviour is rather strange.
--
Witold Baryluk
JID: witold.baryluk // jabster.pl
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: logfs: kernel NULL dereference
2011-09-14 18:34 ` logfs: kernel NULL dereference Jörn Engel
2011-09-14 19:01 ` Witold Baryluk
@ 2011-09-15 14:27 ` Milan Broz
2011-09-15 14:52 ` Jörn Engel
1 sibling, 1 reply; 4+ messages in thread
From: Milan Broz @ 2011-09-15 14:27 UTC (permalink / raw)
To: device-mapper development
Cc: Jörn Engel, Prasad Joshi, Witold Baryluk, Aniket Sane
On 09/14/2011 08:34 PM, Jörn Engel wrote:
> 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.
>
> On Wed, 14 September 2011 20:24:25 +0200, Jörn Engel wrote:
>>
>> 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/loop0
>> cryptsetup luksOpen /dev/loop0 foo
>> pvcreate /dev/mapper/foo
>> vgcreate our_volume /dev/mapper/foo
>> lvcreate -L 128M -n logfstest our_volume
>> yes yes | mklogfs /dev/mapper/our_volume-logfstest
>> mount /dev/mapper/our_volume-logfstest /mnt/
Which kernel version are you using?
>> 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
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: logfs: kernel NULL dereference
2011-09-15 14:27 ` Milan Broz
@ 2011-09-15 14:52 ` Jörn Engel
0 siblings, 0 replies; 4+ messages in thread
From: Jörn Engel @ 2011-09-15 14:52 UTC (permalink / raw)
To: Milan Broz
Cc: device-mapper development, Prasad Joshi, Witold Baryluk,
Aniket Sane
On Thu, 15 September 2011 16:27:52 +0200, Milan Broz wrote:
> On 09/14/2011 08:34 PM, Jörn Engel wrote:
> > 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.
> >
> > On Wed, 14 September 2011 20:24:25 +0200, Jörn Engel wrote:
> >>
> >> 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/loop0
> >> cryptsetup luksOpen /dev/loop0 foo
> >> pvcreate /dev/mapper/foo
> >> vgcreate our_volume /dev/mapper/foo
> >> lvcreate -L 128M -n logfstest our_volume
> >> yes yes | mklogfs /dev/mapper/our_volume-logfstest
> >> mount /dev/mapper/our_volume-logfstest /mnt/
>
> Which kernel version are you using?
Latest git - well, close to latest, given the current kernel.org trouble.
> >> 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
--
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
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-09-15 14:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20110903125637.GG6092@smp.if.uj.edu.pl>
[not found] ` <20110907141527.GM32018@logfs.org>
[not found] ` <20110907210312.GA17634@smp.if.uj.edu.pl>
[not found] ` <20110907220856.GR32018@logfs.org>
[not found] ` <20110908161726.GA9104@smp.if.uj.edu.pl>
[not found] ` <20110914182425.GD24351@logfs.org>
2011-09-14 18:34 ` logfs: kernel NULL dereference Jörn Engel
2011-09-14 19:01 ` Witold Baryluk
2011-09-15 14:27 ` Milan Broz
2011-09-15 14:52 ` Jörn Engel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.