All of lore.kernel.org
 help / color / mirror / Atom feed
* [dm-crypt] luksFormat hangs
@ 2011-06-28 19:56 Martin Hicks
  2011-06-28 20:10 ` Arno Wagner
  2011-06-28 20:14 ` Milan Broz
  0 siblings, 2 replies; 7+ messages in thread
From: Martin Hicks @ 2011-06-28 19:56 UTC (permalink / raw)
  To: dm-crypt

Hello,

I'm trying to create a luks device on an embedded platform running
kernel 2.6.37 and cryptsetup 1.3.1.  I'm sure I've done this before,
but when I tried today I end up with a hang that consumes all CPU and
based on a combination of --debug and strace I think it is in the
PBKDF2_perforance_check function.

/conf/root # cryptsetup --debug -q luksFormat /dev/dtdb1
# cryptsetup 1.3.1 processing "cryptsetup --debug -q luksFormat /dev/dtdb1"
# Running command luksFormat.
# Locking memory.
# Allocating crypt device /dev/dtdb1 context.
# Trying to open and read device /dev/dtdb1.
# Initialising device-mapper backend, UDEV is disabled.
# Detected dm-crypt version 1.7.0, dm-ioctl version 4.18.0.
# Password verification enabled.
# Timeout set to 0 miliseconds.
# Iteration time set to 1000 miliseconds.
# Interactive passphrase entry requested.
Enter LUKS passphrase:
# Formatting device /dev/dtdb1 as type LUKS1.
# OpenSSL crypto backend initialized.
# Topology: IO (512/0), offset = 0; Required alignment is 1048576 bytes.
# Generating LUKS header version 1 using hash sha1, aes,
cbc-essiv:sha256, MK 32 bytes



The platform is ppc mpc8379-rdb.  I've tried on the platform with the
hardware encryption engine and on one without, although I don't think
I'm getting to the stage where the kernel really cares about that.

Any ideas?
thanks,
mh

-- 
Martin Hicks P.Eng.      |         mort@bork.org
Bork Consulting Inc.     |   +1 (613) 266-2296

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

* Re: [dm-crypt] luksFormat hangs
  2011-06-28 19:56 [dm-crypt] luksFormat hangs Martin Hicks
@ 2011-06-28 20:10 ` Arno Wagner
  2011-06-28 20:14 ` Milan Broz
  1 sibling, 0 replies; 7+ messages in thread
From: Arno Wagner @ 2011-06-28 20:10 UTC (permalink / raw)
  To: dm-crypt

Looks like a Bug too me. Or maybe you just dod not wait long
enough? How slow is this platform?

Arno

On Tue, Jun 28, 2011 at 03:56:48PM -0400, Martin Hicks wrote:
> Hello,
> 
> I'm trying to create a luks device on an embedded platform running
> kernel 2.6.37 and cryptsetup 1.3.1.  I'm sure I've done this before,
> but when I tried today I end up with a hang that consumes all CPU and
> based on a combination of --debug and strace I think it is in the
> PBKDF2_perforance_check function.
> 
> /conf/root # cryptsetup --debug -q luksFormat /dev/dtdb1
> # cryptsetup 1.3.1 processing "cryptsetup --debug -q luksFormat /dev/dtdb1"
> # Running command luksFormat.
> # Locking memory.
> # Allocating crypt device /dev/dtdb1 context.
> # Trying to open and read device /dev/dtdb1.
> # Initialising device-mapper backend, UDEV is disabled.
> # Detected dm-crypt version 1.7.0, dm-ioctl version 4.18.0.
> # Password verification enabled.
> # Timeout set to 0 miliseconds.
> # Iteration time set to 1000 miliseconds.
> # Interactive passphrase entry requested.
> Enter LUKS passphrase:
> # Formatting device /dev/dtdb1 as type LUKS1.
> # OpenSSL crypto backend initialized.
> # Topology: IO (512/0), offset = 0; Required alignment is 1048576 bytes.
> # Generating LUKS header version 1 using hash sha1, aes,
> cbc-essiv:sha256, MK 32 bytes
> 
> 
> 
> The platform is ppc mpc8379-rdb.  I've tried on the platform with the
> hardware encryption engine and on one without, although I don't think
> I'm getting to the stage where the kernel really cares about that.
> 
> Any ideas?
> thanks,
> mh
> 
> -- 
> Martin Hicks P.Eng. ?? ? | ? ? ? ? mort@bork.org
> Bork Consulting Inc. ? ? | ? +1 (613) 266-2296
> _______________________________________________
> dm-crypt mailing list
> dm-crypt@saout.de
> http://www.saout.de/mailman/listinfo/dm-crypt
> 

-- 
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: arno@wagner.name 
GnuPG:  ID: 1E25338F  FP: 0C30 5782 9D93 F785 E79C  0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier 

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

* Re: [dm-crypt] luksFormat hangs
  2011-06-28 19:56 [dm-crypt] luksFormat hangs Martin Hicks
  2011-06-28 20:10 ` Arno Wagner
@ 2011-06-28 20:14 ` Milan Broz
  2011-06-28 20:23   ` Martin Hicks
  1 sibling, 1 reply; 7+ messages in thread
From: Milan Broz @ 2011-06-28 20:14 UTC (permalink / raw)
  To: Martin Hicks; +Cc: dm-crypt


Hi,

On 06/28/2011 09:56 PM, Martin Hicks wrote:
> I'm trying to create a luks device on an embedded platform running
> kernel 2.6.37 and cryptsetup 1.3.1.  I'm sure I've done this before,
> but when I tried today I end up with a hang that consumes all CPU and
> based on a combination of --debug and strace I think it is in the
> PBKDF2_perforance_check function.

well, I would really like to know what went wrong there.

Is it something new in 1.3.1? (It shouldn't, there was no changes).

Which compile option are you using (configure options)?
(mainly which crypto backend - libgcrypt?)
Anything special with libc, environment or so?

> /conf/root # cryptsetup --debug -q luksFormat /dev/dtdb1

Can you try to add "-i 1" - is is still looping?

> The platform is ppc mpc8379-rdb.  I've tried on the platform with the
> hardware encryption engine and on one without, although I don't think
> I'm getting to the stage where the kernel really cares about that.

If it is loops in PBKDF2 perf. check, I do not think the problem is in hw
acceleration (depends if userspace lib uses hw acceleration but I think
it is  not, hw acceleration is used probably in kernel only.)

I guess "cryptsetup create" command work without problem, right?

Milan

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

* Re: [dm-crypt] luksFormat hangs
  2011-06-28 20:14 ` Milan Broz
@ 2011-06-28 20:23   ` Martin Hicks
  2011-06-28 20:30     ` Milan Broz
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Hicks @ 2011-06-28 20:23 UTC (permalink / raw)
  To: Milan Broz; +Cc: dm-crypt

On Tue, Jun 28, 2011 at 4:14 PM, Milan Broz <mbroz@redhat.com> wrote:
>
> Hi,
>
> On 06/28/2011 09:56 PM, Martin Hicks wrote:
>> I'm trying to create a luks device on an embedded platform running
>> kernel 2.6.37 and cryptsetup 1.3.1.  I'm sure I've done this before,
>> but when I tried today I end up with a hang that consumes all CPU and
>> based on a combination of --debug and strace I think it is in the
>> PBKDF2_perforance_check function.
>
> well, I would really like to know what went wrong there.

I see what the problem is.  Must be a compiler bug of some kind on our platform.

rt_sigaction(SIGVTALRM, {0xffd60b4, [VTALRM], SA_RESTART}, {SIG_DFL,
[], 0}, 8) = 0
setitimer(ITIMER_VIRTUAL, {it_interval={0, 0}, it_value={1, 0}}, NULL) = 0


That is correct, I think.  It's just setting the timer to let the
performance test run for 1 second, but I never seem to get the
wake-up...

I'll have to see if I can find a reason why VTALRM is disabled,
doesn't exist or whatever on my platform...

mh

-- 
Martin Hicks P.Eng.      |         mort@bork.org
Bork Consulting Inc.     |   +1 (613) 266-2296

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

* Re: [dm-crypt] luksFormat hangs
  2011-06-28 20:23   ` Martin Hicks
@ 2011-06-28 20:30     ` Milan Broz
  2011-06-28 20:34       ` Martin Hicks
  2011-06-30 17:53       ` Martin Hicks
  0 siblings, 2 replies; 7+ messages in thread
From: Milan Broz @ 2011-06-28 20:30 UTC (permalink / raw)
  To: Martin Hicks; +Cc: dm-crypt

On 06/28/2011 10:23 PM, Martin Hicks wrote:
> I see what the problem is.  Must be a compiler bug of some kind on our platform.
> 
> rt_sigaction(SIGVTALRM, {0xffd60b4, [VTALRM], SA_RESTART}, {SIG_DFL,
> [], 0}, 8) = 0
> setitimer(ITIMER_VIRTUAL, {it_interval={0, 0}, it_value={1, 0}}, NULL) = 0
> 
> 
> That is correct, I think.  It's just setting the timer to let the
> performance test run for 1 second, but I never seem to get the
> wake-up...

There was already bug in Gentoo hardened triggered by this code
https://bugs.gentoo.org/show_bug.cgi?id=283470
That's why I asked which libc is used. It seems to me like bug in timer
code but it need probably more investigation.

> I'll have to see if I can find a reason why VTALRM is disabled,
> doesn't exist or whatever on my platform...

I am trying to test all architectures possible, so if there is some
problem or bug, please let me know. (PPC/PPC64 should work without problem).

Milan

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

* Re: [dm-crypt] luksFormat hangs
  2011-06-28 20:30     ` Milan Broz
@ 2011-06-28 20:34       ` Martin Hicks
  2011-06-30 17:53       ` Martin Hicks
  1 sibling, 0 replies; 7+ messages in thread
From: Martin Hicks @ 2011-06-28 20:34 UTC (permalink / raw)
  To: Milan Broz; +Cc: dm-crypt

On Tue, Jun 28, 2011 at 4:30 PM, Milan Broz <mbroz@redhat.com> wrote:
> On 06/28/2011 10:23 PM, Martin Hicks wrote:
>> I see what the problem is.  Must be a compiler bug of some kind on our platform.
>>
>> rt_sigaction(SIGVTALRM, {0xffd60b4, [VTALRM], SA_RESTART}, {SIG_DFL,
>> [], 0}, 8) = 0
>> setitimer(ITIMER_VIRTUAL, {it_interval={0, 0}, it_value={1, 0}}, NULL) = 0
>>
>>
>> That is correct, I think.  It's just setting the timer to let the
>> performance test run for 1 second, but I never seem to get the
>> wake-up...
>
> There was already bug in Gentoo hardened triggered by this code
> https://bugs.gentoo.org/show_bug.cgi?id=283470
> That's why I asked which libc is used. It seems to me like bug in timer
> code but it need probably more investigation.

I can try a similar fix and see if it helps.

We're using buildroot to generate the firmware images, and using the
Codesourcery 2010.09 powerpc/freescale toolchain, and the glibc that
comes with it.

>
>> I'll have to see if I can find a reason why VTALRM is disabled,
>> doesn't exist or whatever on my platform...
>
> I am trying to test all architectures possible, so if there is some
> problem or bug, please let me know. (PPC/PPC64 should work without problem).

I'll let you know if I figure anything out.
mh

-- 
Martin Hicks P.Eng.      |         mort@bork.org
Bork Consulting Inc.     |   +1 (613) 266-2296

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

* Re: [dm-crypt] luksFormat hangs
  2011-06-28 20:30     ` Milan Broz
  2011-06-28 20:34       ` Martin Hicks
@ 2011-06-30 17:53       ` Martin Hicks
  1 sibling, 0 replies; 7+ messages in thread
From: Martin Hicks @ 2011-06-30 17:53 UTC (permalink / raw)
  To: Milan Broz; +Cc: dm-crypt

A switch of cross compile toolchains fixed my problem.  This isn't the
first random toolchain bug I've found in the codesourcery freescale
2010.09 release.

mh

On Tue, Jun 28, 2011 at 4:30 PM, Milan Broz <mbroz@redhat.com> wrote:
> On 06/28/2011 10:23 PM, Martin Hicks wrote:
>> I see what the problem is.  Must be a compiler bug of some kind on our platform.
>>
>> rt_sigaction(SIGVTALRM, {0xffd60b4, [VTALRM], SA_RESTART}, {SIG_DFL,
>> [], 0}, 8) = 0
>> setitimer(ITIMER_VIRTUAL, {it_interval={0, 0}, it_value={1, 0}}, NULL) = 0
>>
>>
>> That is correct, I think.  It's just setting the timer to let the
>> performance test run for 1 second, but I never seem to get the
>> wake-up...
>
> There was already bug in Gentoo hardened triggered by this code
> https://bugs.gentoo.org/show_bug.cgi?id=283470
> That's why I asked which libc is used. It seems to me like bug in timer
> code but it need probably more investigation.
>
>> I'll have to see if I can find a reason why VTALRM is disabled,
>> doesn't exist or whatever on my platform...
>
> I am trying to test all architectures possible, so if there is some
> problem or bug, please let me know. (PPC/PPC64 should work without problem).
>
> Milan
>



-- 
Martin Hicks P.Eng.      |         mort@bork.org
Bork Consulting Inc.     |   +1 (613) 266-2296

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

end of thread, other threads:[~2011-06-30 19:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-28 19:56 [dm-crypt] luksFormat hangs Martin Hicks
2011-06-28 20:10 ` Arno Wagner
2011-06-28 20:14 ` Milan Broz
2011-06-28 20:23   ` Martin Hicks
2011-06-28 20:30     ` Milan Broz
2011-06-28 20:34       ` Martin Hicks
2011-06-30 17:53       ` Martin Hicks

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.