linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [2.6.30-rc1] device-mapper: table: 254:0: crypt: Error allocating crypto tfm
@ 2009-04-08 19:35 Maciej Rutecki
  2009-04-08 19:36 ` Maciej Rutecki
  2009-04-09  2:18 ` Herbert Xu
  0 siblings, 2 replies; 9+ messages in thread
From: Maciej Rutecki @ 2009-04-08 19:35 UTC (permalink / raw)
  To: Linux Kernel Mailing List, Rafael J. Wysocki, herbert, davem,
	linux-crypto

Kernel 2.6.30.1

I try mount encrypted partition:
root@zlom:/home/maciek# cryptsetup create secret /dev/sda6
Enter passphrase:
Command failed: device-mapper: reload ioctl failed: Zły argument

"Zły argument"="Bad argument"

Dmesg shows:
[  193.421463] device-mapper: table: 254:0: crypt: Error allocating crypto tfm
[  193.421471] device-mapper: ioctl: error adding target to table
[  193.465318] device-mapper: ioctl: device doesn't appear to be in
the dev hash table

BUT, I try again:
root@zlom:/home/maciek# cryptsetup create secret /dev/sda6
Enter passphrase:
root@zlom:/home/maciek# mount /mnt/sec/
root@zlom:/home/maciek# df -h | grep sec
/dev/mapper/secret     89G   42G   43G  50% /mnt/sec

Then it works.

root@zlom:/home/maciek# cat /proc/crypto
name         : cbc(aes)
driver       : cbc(aes-asm)
module       : kernel
priority     : 200
refcnt       : 2
selftest     : passed
type         : givcipher
async        : yes
blocksize    : 16
min keysize  : 16
max keysize  : 32
ivsize       : 16
geniv        : chainiv

name         : cbc(aes)
driver       : cbc(aes-asm)
module       : cbc
priority     : 200
refcnt       : 2
selftest     : passed
type         : blkcipher
blocksize    : 16
min keysize  : 16
max keysize  : 32
ivsize       : 16
geniv        : <default>

name         : aes
driver       : aes-asm
module       : aes_i586
priority     : 200
refcnt       : 2
selftest     : passed
type         : cipher
blocksize    : 16
min keysize  : 16
max keysize  : 32

name         : aes
driver       : aes-generic
module       : aes_generic
priority     : 100
refcnt       : 1
selftest     : passed
type         : cipher
blocksize    : 16
min keysize  : 16
max keysize  : 32

name         : stdrng
driver       : krng
module       : kernel
priority     : 200
refcnt       : 2
selftest     : passed
type         : rng
seedsize     : 0

name         : md5
driver       : md5-generic
module       : kernel
priority     : 0
refcnt       : 1
selftest     : passed
type         : shash
blocksize    : 64
digestsize   : 16
descsize     : 88

Any else information is needed?

Config:
http://unixy.pl/maciek/download/kernel/2.6.30-rc1/pc/config-2.6.30-rc1.txt

dmesg:
http://unixy.pl/maciek/download/kernel/2.6.30-rc1/pc/dmesg.txt
-- 
Maciej Rutecki
http://www.maciek.unixy.pl
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [2.6.30-rc1] device-mapper: table: 254:0: crypt: Error allocating crypto tfm
  2009-04-08 19:35 [2.6.30-rc1] device-mapper: table: 254:0: crypt: Error allocating crypto tfm Maciej Rutecki
@ 2009-04-08 19:36 ` Maciej Rutecki
  2009-04-09  2:18 ` Herbert Xu
  1 sibling, 0 replies; 9+ messages in thread
From: Maciej Rutecki @ 2009-04-08 19:36 UTC (permalink / raw)
  To: Linux Kernel Mailing List, Rafael J. Wysocki, herbert, davem,
	linux-crypto

2009/4/8 Maciej Rutecki <maciej.rutecki@gmail.com>:
> Kernel 2.6.30.1

s/2.6.30.1/2.6.30-rc1




-- 
Maciej Rutecki
http://www.maciek.unixy.pl

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [2.6.30-rc1] device-mapper: table: 254:0: crypt: Error allocating crypto tfm
  2009-04-08 19:35 [2.6.30-rc1] device-mapper: table: 254:0: crypt: Error allocating crypto tfm Maciej Rutecki
  2009-04-08 19:36 ` Maciej Rutecki
@ 2009-04-09  2:18 ` Herbert Xu
  2009-04-09  2:35   ` Herbert Xu
  1 sibling, 1 reply; 9+ messages in thread
From: Herbert Xu @ 2009-04-09  2:18 UTC (permalink / raw)
  To: Maciej Rutecki
  Cc: Linux Kernel Mailing List, Rafael J. Wysocki, davem, linux-crypto

On Wed, Apr 08, 2009 at 09:35:23PM +0200, Maciej Rutecki wrote:
> Kernel 2.6.30.1
> 
> I try mount encrypted partition:
> root@zlom:/home/maciek# cryptsetup create secret /dev/sda6
> Enter passphrase:
> Command failed: device-mapper: reload ioctl failed: Zły argument
> 
> "Zły argument"="Bad argument"

It looks like try_then_request_module has been broken such that it
returns without waiting for the module to complete loading.  I'm
looking into it.

Thakns,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [2.6.30-rc1] device-mapper: table: 254:0: crypt: Error allocating crypto tfm
  2009-04-09  2:18 ` Herbert Xu
@ 2009-04-09  2:35   ` Herbert Xu
  2009-04-09 12:46     ` Maciej Rutecki
  0 siblings, 1 reply; 9+ messages in thread
From: Herbert Xu @ 2009-04-09  2:35 UTC (permalink / raw)
  To: Maciej Rutecki
  Cc: Linux Kernel Mailing List, Rafael J. Wysocki, davem, linux-crypto,
	arjan, Linus Torvalds, Andrew Morton, Rusty Russell, Jiri Slaby

On Thu, Apr 09, 2009 at 10:18:04AM +0800, Herbert Xu wrote:
>
> It looks like try_then_request_module has been broken such that it
> returns without waiting for the module to complete loading.  I'm
> looking into it.

OK, it's caused by

commit acae05156551fd7528fbb616271e672789388e3c
Author: Arjan van de Ven <arjan@linux.intel.com>
Date:   Sun Feb 8 10:42:01 2009 -0800

    module: create a request_module_nowait()

This should fix it.

module: try_then_request_module must wait

Since the whole point of try_then_request_module is to retry
the operation after a module has been loaded, we must wait for
the module to fully load.

Otherwise all sort of things start breaking, e.g., you won't
be able to read your encrypted disks on the first attempt.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index d5fa565..384ca8b 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -34,7 +34,7 @@ extern int __request_module(bool wait, const char *name, ...) \
 #define request_module(mod...) __request_module(true, mod)
 #define request_module_nowait(mod...) __request_module(false, mod)
 #define try_then_request_module(x, mod...) \
-	((x) ?: (__request_module(false, mod), (x)))
+	((x) ?: (__request_module(true, mod), (x)))
 #else
 static inline int request_module(const char *name, ...) { return -ENOSYS; }
 static inline int request_module_nowait(const char *name, ...) { return -ENOSYS; }

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [2.6.30-rc1] device-mapper: table: 254:0: crypt: Error allocating crypto tfm
  2009-04-09  2:35   ` Herbert Xu
@ 2009-04-09 12:46     ` Maciej Rutecki
  2009-04-09 13:05       ` Patrick McHardy
  0 siblings, 1 reply; 9+ messages in thread
From: Maciej Rutecki @ 2009-04-09 12:46 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Linux Kernel Mailing List, Rafael J. Wysocki, davem, linux-crypto,
	arjan, Linus Torvalds, Andrew Morton, Rusty Russell, Jiri Slaby

2009/4/9 Herbert Xu <herbert@gondor.apana.org.au>:
[...]

Yes, patch helps. Thanks

Tested-by Maciej Rutecki <maciej.rutecki@gmail.com>

> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
>
> diff --git a/include/linux/kmod.h b/include/linux/kmod.h
> index d5fa565..384ca8b 100644
> --- a/include/linux/kmod.h
> +++ b/include/linux/kmod.h
> @@ -34,7 +34,7 @@ extern int __request_module(bool wait, const char *name, ...) \
>  #define request_module(mod...) __request_module(true, mod)
>  #define request_module_nowait(mod...) __request_module(false, mod)
>  #define try_then_request_module(x, mod...) \
> -       ((x) ?: (__request_module(false, mod), (x)))
> +       ((x) ?: (__request_module(true, mod), (x)))
>  #else
>  static inline int request_module(const char *name, ...) { return -ENOSYS; }
>  static inline int request_module_nowait(const char *name, ...) { return -ENOSYS; }
>
> Thanks,
> --
> Visit Openswan at http://www.openswan.org/
> Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

-- 
Maciej Rutecki
http://www.maciek.unixy.pl
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [2.6.30-rc1] device-mapper: table: 254:0: crypt: Error allocating crypto tfm
  2009-04-09 12:46     ` Maciej Rutecki
@ 2009-04-09 13:05       ` Patrick McHardy
  2009-04-09 13:14         ` Maciej Rutecki
  2009-04-09 13:18         ` Herbert Xu
  0 siblings, 2 replies; 9+ messages in thread
From: Patrick McHardy @ 2009-04-09 13:05 UTC (permalink / raw)
  To: Maciej Rutecki
  Cc: Herbert Xu, Linux Kernel Mailing List, Rafael J. Wysocki, davem,
	linux-crypto, arjan, Linus Torvalds, Andrew Morton, Rusty Russell,
	Jiri Slaby

Maciej Rutecki wrote:
> 2009/4/9 Herbert Xu <herbert@gondor.apana.org.au>:
> [...]
> 
> Yes, patch helps. Thanks

It also seems to fix a netfilter problem with modules not loaded
automatically anymore.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [2.6.30-rc1] device-mapper: table: 254:0: crypt: Error allocating crypto tfm
  2009-04-09 13:05       ` Patrick McHardy
@ 2009-04-09 13:14         ` Maciej Rutecki
  2009-04-09 13:18         ` Herbert Xu
  1 sibling, 0 replies; 9+ messages in thread
From: Maciej Rutecki @ 2009-04-09 13:14 UTC (permalink / raw)
  To: Patrick McHardy
  Cc: Herbert Xu, Linux Kernel Mailing List, Rafael J. Wysocki, davem,
	linux-crypto, arjan, Linus Torvalds, Andrew Morton, Rusty Russell,
	Jiri Slaby

2009/4/9 Patrick McHardy <kaber@trash.net>:
> Maciej Rutecki wrote:
>>
>> 2009/4/9 Herbert Xu <herbert@gondor.apana.org.au>:
>> [...]
>>
>> Yes, patch helps. Thanks
>
> It also seems to fix a netfilter problem with modules not loaded
> automatically anymore.
>

...and mount my usb disk :-)

-- 
Maciej Rutecki
http://www.maciek.unixy.pl

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [2.6.30-rc1] device-mapper: table: 254:0: crypt: Error allocating crypto tfm
  2009-04-09 13:05       ` Patrick McHardy
  2009-04-09 13:14         ` Maciej Rutecki
@ 2009-04-09 13:18         ` Herbert Xu
  2009-04-09 13:22           ` Patrick McHardy
  1 sibling, 1 reply; 9+ messages in thread
From: Herbert Xu @ 2009-04-09 13:18 UTC (permalink / raw)
  To: Patrick McHardy
  Cc: Maciej Rutecki, Linux Kernel Mailing List, Rafael J. Wysocki,
	davem, linux-crypto, arjan, Linus Torvalds, Andrew Morton,
	Rusty Russell, Jiri Slaby

On Thu, Apr 09, 2009 at 03:05:51PM +0200, Patrick McHardy wrote:
>
> It also seems to fix a netfilter problem with modules not loaded
> automatically anymore.

They should still autoload, but now you need to retry the operation
manually :)
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [2.6.30-rc1] device-mapper: table: 254:0: crypt: Error allocating crypto tfm
  2009-04-09 13:18         ` Herbert Xu
@ 2009-04-09 13:22           ` Patrick McHardy
  0 siblings, 0 replies; 9+ messages in thread
From: Patrick McHardy @ 2009-04-09 13:22 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Maciej Rutecki, Linux Kernel Mailing List, Rafael J. Wysocki,
	davem, linux-crypto, arjan, Linus Torvalds, Andrew Morton,
	Rusty Russell, Jiri Slaby

Herbert Xu wrote:
> On Thu, Apr 09, 2009 at 03:05:51PM +0200, Patrick McHardy wrote:
>> It also seems to fix a netfilter problem with modules not loaded
>> automatically anymore.
> 
> They should still autoload, but now you need to retry the operation
> manually :)

Right, the second attempt succeeded :)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-04-09 13:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-08 19:35 [2.6.30-rc1] device-mapper: table: 254:0: crypt: Error allocating crypto tfm Maciej Rutecki
2009-04-08 19:36 ` Maciej Rutecki
2009-04-09  2:18 ` Herbert Xu
2009-04-09  2:35   ` Herbert Xu
2009-04-09 12:46     ` Maciej Rutecki
2009-04-09 13:05       ` Patrick McHardy
2009-04-09 13:14         ` Maciej Rutecki
2009-04-09 13:18         ` Herbert Xu
2009-04-09 13:22           ` Patrick McHardy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).