linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: cryptsetup not working under 3.6 - RT patch set seem to break it
       [not found]                   ` <508EE395.9010709-9sj9WOxYP5jR7s880joybQ@public.gmane.org>
@ 2012-10-29 20:45                     ` Tvrtko Ursulin
  2012-10-29 23:51                       ` [dm-crypt] " Thomas Gleixner
  2012-10-30  9:40                       ` Uwe Kleine-König
  0 siblings, 2 replies; 8+ messages in thread
From: Tvrtko Ursulin @ 2012-10-29 20:45 UTC (permalink / raw)
  To: Milan Broz
  Cc: dm-crypt-4q3lyFh4P1g, okozina-H+wXaHxf7aLQT0dZR+AlfA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-rt-users-u79uwXL29TY76Z2rM5mHXA

On 29/10/12 20:14, Tvrtko Ursulin wrote:
> On 29/10/12 19:47, Milan Broz wrote:
>> On 10/29/2012 08:31 PM, Tvrtko Ursulin wrote:
>>> Just tried 3.6.4 and it is still broken. Is there anything else I could
>>> try to debug this?
>>
>> See response from response from Ondra on dmcrypt list - your kernel
>> config
>> is perhaps broken.
>
> I don't think that reached me - perhaps I was not copied.
>
> Weird yes, I mean no one can spot anything bad with my config...
>
>> Please use fresh checkout, run make oldconfig and try again.
>> (Many people use 3.6 already and there is no other report.)
>
> ... and I just used it today to configure a fresh 3.6.4 (plus -rt10
> patches) without a problem.
>
> Unless RT patchset is the culprit. Hm.. that would be unexpected, but I
> guess it is worth a shot. I'll let you know what happens without -rt.

Ha, this is exciting, vanilla 3.6.4 works, with -rt10 patch it does not.

Copying in linux-rt-users.

To recap, 3.6 RT seems to break dm-crypt. Try it like this:

cryptsetup --debug --key-file=- luksOpen /some/luks/formatted/file any-label

And kernel will fail like this:

Kernel says this:
      device-mapper: table: 252:1: crypt: Error allocating crypto tfm
      device-mapper: ioctl: error adding target to table

I think crypto modules are not getting auto loaded for some reason, but 
even if I load them manually before hand and still breaks in the same way.

Maybe someone will have a "ah yes" moment? Here is the diff between 
working (vanilla 3.6.4) and non-working (3.6.4-rt10) configs:

--- 1	2012-10-29 20:37:49.472306922 +0000
+++ 2	2012-10-29 20:37:52.319732779 +0000
@@ -892,7 +892,6 @@
  # CONFIG_DEBUG_SECTION_MISMATCH is not set
  # CONFIG_DEBUG_SET_MODULE_RONX is not set
  # CONFIG_DEBUG_SG is not set
-# CONFIG_DEBUG_SHIRQ is not set
  # CONFIG_DEBUG_SPINLOCK is not set
  # CONFIG_DEBUG_STACKOVERFLOW is not set
  # CONFIG_DEBUG_STACK_USAGE is not set
@@ -1810,7 +1809,7 @@
  CONFIG_MTRR_SANITIZER=y
  CONFIG_MTRR=y
  # CONFIG_MULTICORE_RAID456 is not set
-CONFIG_MUTEX_SPIN_ON_OWNER=y
+# CONFIG_MUTEX_SPIN_ON_OWNER is not set
  # CONFIG_MWAVE is not set
  CONFIG_NAMESPACES=y
  CONFIG_NATIONAL_PHY=y
@@ -1842,7 +1841,6 @@
  CONFIG_NET_CLS_TCINDEX=m
  CONFIG_NET_CLS_U32=m
  CONFIG_NET_CLS=y
-# CONFIG_NETCONSOLE is not set
  CONFIG_NET_CORE=y
  CONFIG_NETDEVICES=y
  # CONFIG_NET_DSA is not set
@@ -2260,9 +2258,13 @@
  CONFIG_PPP=y
  # CONFIG_PPS is not set
  CONFIG_PREEMPT_COUNT=y
+# CONFIG_PREEMPT__LL is not set
  # CONFIG_PREEMPT_NONE is not set
  CONFIG_PREEMPT_NOTIFIERS=y
  CONFIG_PREEMPT_RCU=y
+CONFIG_PREEMPT_RT_BASE=y
+# CONFIG_PREEMPT_RTB is not set
+CONFIG_PREEMPT_RT_FULL=y
  # CONFIG_PREEMPT_VOLUNTARY is not set
  CONFIG_PREEMPT=y
  CONFIG_PREVENT_FIRMWARE_BUILD=y
@@ -2368,11 +2370,10 @@
  CONFIG_RTC_INTF_PROC=y
  CONFIG_RTC_INTF_SYSFS=y
  CONFIG_RTC_LIB=y
-# CONFIG_RT_GROUP_SCHED is not set
  CONFIG_RT_MUTEXES=y
  # CONFIG_RT_MUTEX_TESTER is not set
-# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
-CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
  # CONFIG_SAMPLES is not set
  # CONFIG_SATA_ACARD_AHCI is not set
  CONFIG_SATA_AHCI=m
@@ -2851,7 +2852,6 @@
  CONFIG_TRACE_IRQFLAGS_SUPPORT=y
  # CONFIG_TRACE_SINK is not set
  CONFIG_TRACING_SUPPORT=y
-# CONFIG_TRANSPARENT_HUGEPAGE is not set
  CONFIG_TREE_PREEMPT_RCU=y
  # CONFIG_TREE_RCU_TRACE is not set
  CONFIG_TUN=y
@@ -2867,7 +2867,6 @@
  CONFIG_UID16=y
  # CONFIG_UIO is not set
  # CONFIG_ULTRIX_PARTITION is not set
-CONFIG_UNINLINE_SPIN_UNLOCK=y
  CONFIG_UNIX98_PTYS=y
  CONFIG_UNIX_DIAG=y
  # CONFIG_UNIXWARE_DISKLABEL is not set

No crypto related differences.

Tvrtko




_______________________________________________
dm-crypt mailing list
dm-crypt-4q3lyFh4P1g@public.gmane.org
http://www.saout.de/mailman/listinfo/dm-crypt

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

* Re: [dm-crypt] cryptsetup not working under 3.6 - RT patch set seem to break it
  2012-10-29 20:45                     ` cryptsetup not working under 3.6 - RT patch set seem to break it Tvrtko Ursulin
@ 2012-10-29 23:51                       ` Thomas Gleixner
  2012-10-30  9:40                       ` Uwe Kleine-König
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas Gleixner @ 2012-10-29 23:51 UTC (permalink / raw)
  To: Tvrtko Ursulin
  Cc: Milan Broz, dm-crypt, linux-kernel, okozina, linux-rt-users

On Mon, 29 Oct 2012, Tvrtko Ursulin wrote:
> On 29/10/12 20:14, Tvrtko Ursulin wrote:
> > Unless RT patchset is the culprit. Hm.. that would be unexpected, but I
> > guess it is worth a shot. I'll let you know what happens without -rt.
> 
> Ha, this is exciting, vanilla 3.6.4 works, with -rt10 patch it does not.
> 
> Copying in linux-rt-users.
> 
> To recap, 3.6 RT seems to break dm-crypt. Try it like this:
> 
> cryptsetup --debug --key-file=- luksOpen /some/luks/formatted/file any-label
> 
> And kernel will fail like this:
> 
> Kernel says this:
>      device-mapper: table: 252:1: crypt: Error allocating crypto tfm
>      device-mapper: ioctl: error adding target to table
> 
> I think crypto modules are not getting auto loaded for some reason, but even
> if I load them manually before hand and still breaks in the same way.

I don't think it's a module problem. That code is not very helpful due
to _NOT_ showing the error number so it's hard to decode what actually
fails.

I put this on my todo list, but TBH it's low on my radar. If you are
interested then try to capture the failure with the function
tracer. Put a tracing_off() call into the failure code path, i.e.:

        ret = crypt_alloc_tfms(cc, cipher_api);
        if (ret < 0) {
+	   	tracing_off();
                ti->error = "Error allocating crypto tfm";
		        goto bad;
	}

Enable the function tracer before doing the cryptsetup invocation and
after that read out the trace, compress it and put it somewhere to
download or send it to me in private mail if you don't have a place to
put it.

I can decode the trace, but I don't have the capacity at the moment to
setup all the necessary stuff here and do the debugging myself.

Thanks,

	tglx


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

* Re: [dm-crypt] cryptsetup not working under 3.6 - RT patch set seem to break it
  2012-10-29 20:45                     ` cryptsetup not working under 3.6 - RT patch set seem to break it Tvrtko Ursulin
  2012-10-29 23:51                       ` [dm-crypt] " Thomas Gleixner
@ 2012-10-30  9:40                       ` Uwe Kleine-König
  2012-10-30  9:55                         ` Milan Broz
  1 sibling, 1 reply; 8+ messages in thread
From: Uwe Kleine-König @ 2012-10-30  9:40 UTC (permalink / raw)
  To: Tvrtko Ursulin
  Cc: Milan Broz, dm-crypt, linux-kernel, okozina, linux-rt-users

On Mon, Oct 29, 2012 at 08:45:38PM +0000, Tvrtko Ursulin wrote:
> On 29/10/12 20:14, Tvrtko Ursulin wrote:
> >On 29/10/12 19:47, Milan Broz wrote:
> >>On 10/29/2012 08:31 PM, Tvrtko Ursulin wrote:
> >>>Just tried 3.6.4 and it is still broken. Is there anything else I could
> >>>try to debug this?
> >>
> >>See response from response from Ondra on dmcrypt list - your kernel
> >>config
> >>is perhaps broken.
> >
> >I don't think that reached me - perhaps I was not copied.
> >
> >Weird yes, I mean no one can spot anything bad with my config...
> >
> >>Please use fresh checkout, run make oldconfig and try again.
> >>(Many people use 3.6 already and there is no other report.)
> >
> >... and I just used it today to configure a fresh 3.6.4 (plus -rt10
> >patches) without a problem.
> >
> >Unless RT patchset is the culprit. Hm.. that would be unexpected, but I
> >guess it is worth a shot. I'll let you know what happens without -rt.
> 
> Ha, this is exciting, vanilla 3.6.4 works, with -rt10 patch it does not.
I experienced that problem, too. This is on a laptop with encrypted
rootfs, so debugging is a bit harder here. I am just setting up another
machine to debug that.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [dm-crypt] cryptsetup not working under 3.6 - RT patch set seem to break it
  2012-10-30  9:40                       ` Uwe Kleine-König
@ 2012-10-30  9:55                         ` Milan Broz
  2012-10-30 15:27                           ` [PATCH] Fix crypto api init for 3.6.4-rt10 Milan Broz
  0 siblings, 1 reply; 8+ messages in thread
From: Milan Broz @ 2012-10-30  9:55 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Tvrtko Ursulin, Milan Broz, dm-crypt, linux-kernel, okozina,
	linux-rt-users

On 10/30/2012 10:40 AM, Uwe Kleine-König wrote:
>> Ha, this is exciting, vanilla 3.6.4 works, with -rt10 patch it does not.
> I experienced that problem, too. This is on a laptop with encrypted
> rootfs, so debugging is a bit harder here. I am just setting up another
> machine to debug that.

FYI the problematic patch is peterz-srcu-crypto-chain.patch in rt10
patchset, after that, crypto_alloc_ablkcipher() now returns -ENOENT (-2)
in dmcrypt.

(I will check it later but maybe someone already playing with it...)

Milan

--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" 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] 8+ messages in thread

* [PATCH] Fix crypto api init for 3.6.4-rt10
  2012-10-30  9:55                         ` Milan Broz
@ 2012-10-30 15:27                           ` Milan Broz
  2012-10-30 17:57                             ` Thomas Gleixner
  2012-10-30 18:24                             ` Tvrtko Ursulin
  0 siblings, 2 replies; 8+ messages in thread
From: Milan Broz @ 2012-10-30 15:27 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Tvrtko Ursulin, linux-rt-users, dm-crypt, linux-kernel, okozina

Fix crypto api for 3.6.4-rt10 (broken only in realtime patchset)

In peterz-srcu-crypto-chain.patch the blocking notifier is changed
to srcu notifier and added initialization to module init fucntion.

Later, in crypto-make-core-static-and-init-scru-early.patch, is that
initialization added also to core_initcall().

This patch removes crypto_chain init from algapi initialization,
because this function is called later and already initialized
cryptomgr notifier is lost.

This cause a failure in initialization of larval algorithms,
like e.g. cbc(aes).

Signed-off-by: Milan Broz <mbroz@redhat.com>

--- crypto/algapi.c.old	2012-10-30 16:11:23.000000000 +0100
+++ crypto/algapi.c	2012-10-30 16:12:14.988847944 +0100
@@ -956,7 +956,6 @@ EXPORT_SYMBOL_GPL(crypto_xor);
 
 static int __init crypto_algapi_init(void)
 {
-	srcu_init_notifier_head(&crypto_chain);
 	crypto_init_proc();
 	return 0;
 }

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

* Re: [PATCH] Fix crypto api init for 3.6.4-rt10
  2012-10-30 15:27                           ` [PATCH] Fix crypto api init for 3.6.4-rt10 Milan Broz
@ 2012-10-30 17:57                             ` Thomas Gleixner
  2012-10-30 20:35                               ` Uwe Kleine-König
  2012-10-30 18:24                             ` Tvrtko Ursulin
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas Gleixner @ 2012-10-30 17:57 UTC (permalink / raw)
  To: Milan Broz
  Cc: Uwe Kleine-König, Tvrtko Ursulin, linux-rt-users, dm-crypt,
	linux-kernel, okozina

On Tue, 30 Oct 2012, Milan Broz wrote:

> Fix crypto api for 3.6.4-rt10 (broken only in realtime patchset)
> 
> In peterz-srcu-crypto-chain.patch the blocking notifier is changed
> to srcu notifier and added initialization to module init fucntion.
> 
> Later, in crypto-make-core-static-and-init-scru-early.patch, is that
> initialization added also to core_initcall().
> 
> This patch removes crypto_chain init from algapi initialization,
> because this function is called later and already initialized
> cryptomgr notifier is lost.

Grrr. So I forgot top zap the one Peter added. Stupid me.
 
> This cause a failure in initialization of larval algorithms,
> like e.g. cbc(aes).

Thanks for spotting!
 
> Signed-off-by: Milan Broz <mbroz@redhat.com>
> 
> --- crypto/algapi.c.old	2012-10-30 16:11:23.000000000 +0100
> +++ crypto/algapi.c	2012-10-30 16:12:14.988847944 +0100
> @@ -956,7 +956,6 @@ EXPORT_SYMBOL_GPL(crypto_xor);
>  
>  static int __init crypto_algapi_init(void)
>  {
> -	srcu_init_notifier_head(&crypto_chain);
>  	crypto_init_proc();
>  	return 0;
>  }
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rt-users" 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] 8+ messages in thread

* Re: [PATCH] Fix crypto api init for 3.6.4-rt10
  2012-10-30 15:27                           ` [PATCH] Fix crypto api init for 3.6.4-rt10 Milan Broz
  2012-10-30 17:57                             ` Thomas Gleixner
@ 2012-10-30 18:24                             ` Tvrtko Ursulin
  1 sibling, 0 replies; 8+ messages in thread
From: Tvrtko Ursulin @ 2012-10-30 18:24 UTC (permalink / raw)
  To: Milan Broz
  Cc: Uwe Kleine-König, linux-rt-users, dm-crypt, linux-kernel,
	okozina


Hi,

On 30/10/12 15:27, Milan Broz wrote:
> Fix crypto api for 3.6.4-rt10 (broken only in realtime patchset)
>
> In peterz-srcu-crypto-chain.patch the blocking notifier is changed
> to srcu notifier and added initialization to module init fucntion.
>
> Later, in crypto-make-core-static-and-init-scru-early.patch, is that
> initialization added also to core_initcall().
>
> This patch removes crypto_chain init from algapi initialization,
> because this function is called later and already initialized
> cryptomgr notifier is lost.
>
> This cause a failure in initialization of larval algorithms,
> like e.g. cbc(aes).

Thanks for the quick fix!

Tvrtko

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

* Re: [PATCH] Fix crypto api init for 3.6.4-rt10
  2012-10-30 17:57                             ` Thomas Gleixner
@ 2012-10-30 20:35                               ` Uwe Kleine-König
  0 siblings, 0 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2012-10-30 20:35 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Milan Broz, Tvrtko Ursulin, linux-rt-users, dm-crypt,
	linux-kernel, okozina

Hello,

On Tue, Oct 30, 2012 at 06:57:37PM +0100, Thomas Gleixner wrote:
> On Tue, 30 Oct 2012, Milan Broz wrote:
> 
> > Fix crypto api for 3.6.4-rt10 (broken only in realtime patchset)
> > 
> > In peterz-srcu-crypto-chain.patch the blocking notifier is changed
> > to srcu notifier and added initialization to module init fucntion.
> > 
> > Later, in crypto-make-core-static-and-init-scru-early.patch, is that
> > initialization added also to core_initcall().
> > 
> > This patch removes crypto_chain init from algapi initialization,
> > because this function is called later and already initialized
> > cryptomgr notifier is lost.
> 
> Grrr. So I forgot top zap the one Peter added. Stupid me.
>  
> > This cause a failure in initialization of larval algorithms,
> > like e.g. cbc(aes).
> 
> Thanks for spotting!
This patch fixes booting my laptop. But now it hangs after login.

thanks
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" 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] 8+ messages in thread

end of thread, other threads:[~2012-10-30 20:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <50830D33.5050807@ursulin.net>
     [not found] ` <5083C61C.5090807@gmail.com>
     [not found]   ` <5083E4A8.3060501@ursulin.net>
     [not found]     ` <5083E87B.2080908@gmail.com>
     [not found]       ` <5083EC61.8070505@ursulin.net>
     [not found]         ` <50844D01.9090805@gmail.com>
     [not found]           ` <5084551E.5040304@ursulin.net>
     [not found]             ` <508ED985.5060301@ursulin.net>
     [not found]               ` <508EDD6E.7030908@gmail.com>
     [not found]                 ` <508EE395.9010709@ursulin.net>
     [not found]                   ` <508EE395.9010709-9sj9WOxYP5jR7s880joybQ@public.gmane.org>
2012-10-29 20:45                     ` cryptsetup not working under 3.6 - RT patch set seem to break it Tvrtko Ursulin
2012-10-29 23:51                       ` [dm-crypt] " Thomas Gleixner
2012-10-30  9:40                       ` Uwe Kleine-König
2012-10-30  9:55                         ` Milan Broz
2012-10-30 15:27                           ` [PATCH] Fix crypto api init for 3.6.4-rt10 Milan Broz
2012-10-30 17:57                             ` Thomas Gleixner
2012-10-30 20:35                               ` Uwe Kleine-König
2012-10-30 18:24                             ` Tvrtko Ursulin

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).