2012-06-22 11:15:00

by Sasha Levin

[permalink] [raw]
Subject: crypto: gpf on boot with linux-next

Hi all,

I'm seeing the following panic when booting the latest linux-next kernel:

[ 44.210559] general protection fault: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
[ 44.210618] CPU 0
[ 44.210618] Pid: 1, comm: swapper/0 Tainted: G W 3.5.0-rc3-next-20120622-sasha-dirty #457
[ 44.210618] RIP: 0010:[<ffffffff811644b0>] [<ffffffff811644b0>] __lock_acquire+0x110/0x4b0
[ 44.210618] RSP: 0018:ffff89519a519aa0 EFLAGS: 00010002
[ 44.210618] RAX: 6b6b6b6b6b6b6b6b RBX: ffff89519a510000 RCX: 0000000000000000
[ 44.210618] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
[ 44.210618] RBP: ffff89519a519b00 R08: 0000000000000001 R09: 0000000000000001
[ 44.210618] R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000002
[ 44.210618] R13: ffff8951806f0a40 R14: 0000000000000000 R15: 0000000000000000
[ 44.210618] FS: 0000000000000000(0000) GS:ffff89525ba00000(0000) knlGS:0000000000000000
[ 44.210618] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 44.210618] CR2: 0000000000000000 CR3: 0000000004825000 CR4: 00000000000006f0
[ 44.210618] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 44.210618] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 44.210618] Process swapper/0 (pid: 1, threadinfo ffff89519a518000, task ffff89519a510000)
[ 44.210618] Stack:
[ 44.210618] ffff89519a519ae0 ffffffff810ffa20 ffff89519a519b00 ffffffff85374700
[ 44.210618] ffffffff85374700 00000000fffd0333 ffff89519a519ae0 ffff89519a510000
[ 44.210618] 0000000000000000 0000000000000002 0000000000000000 0000000000000000
[ 44.210618] Call Trace:
[ 44.210618] [<ffffffff810ffa20>] ? del_timer_sync+0x120/0x140
[ 44.210618] [<ffffffff811649da>] lock_acquire+0x18a/0x1e0
[ 44.210618] [<ffffffff836fd47a>] ? wait_for_common+0x10a/0x170
[ 44.210618] [<ffffffff836ff171>] _raw_spin_lock_irq+0x61/0xa0
[ 44.210618] [<ffffffff836fd47a>] ? wait_for_common+0x10a/0x170
[ 44.210618] [<ffffffff836fd47a>] wait_for_common+0x10a/0x170
[ 44.210618] [<ffffffff81133d40>] ? try_to_wake_up+0x290/0x290
[ 44.210618] [<ffffffff836fd52e>] wait_for_completion_interruptible_timeout+0xe/0x10
[ 44.210618] [<ffffffff81913a77>] cryptomgr_schedule_probe+0x2d7/0x310
[ 44.210618] [<ffffffff81913c75>] cryptomgr_notify+0x25/0x40
[ 44.210618] [<ffffffff811231be>] notifier_call_chain+0xee/0x130
[ 44.210618] [<ffffffff811235a6>] __blocking_notifier_call_chain+0xa6/0xd0
[ 44.210618] [<ffffffff8112174e>] ? up_write+0x1e/0x40
[ 44.210618] [<ffffffff811235e1>] blocking_notifier_call_chain+0x11/0x20
[ 44.210618] [<ffffffff8190ad89>] crypto_probing_notify+0x29/0x50
[ 44.210618] [<ffffffff8190b479>] crypto_alg_mod_lookup+0x39/0x80
[ 44.210618] [<ffffffff8190b52c>] crypto_alloc_base+0x3c/0xb0
[ 44.210618] [<ffffffff851675a5>] ? af_rxrpc_init+0x1a3/0x1a3
[ 44.210618] [<ffffffff851675ed>] rxkad_init+0x48/0x69
[ 44.210618] [<ffffffff850cf639>] do_one_initcall+0x7a/0x155
[ 44.210618] [<ffffffff850cf7db>] do_basic_setup+0x9c/0xba
[ 44.210618] [<ffffffff850cf7f9>] ? do_basic_setup+0xba/0xba
[ 44.210618] [<ffffffff850f1173>] ? smp_init+0x8a/0x92
[ 44.210618] [<ffffffff850cfa5c>] kernel_init+0x208/0x28a
[ 44.210618] [<ffffffff83701e34>] kernel_thread_helper+0x4/0x10
[ 44.210618] [<ffffffff837000b4>] ? retint_restore_args+0x13/0x13
[ 44.210618] [<ffffffff850cf854>] ? repair_env_string+0x5b/0x5b
[ 44.210618] [<ffffffff83701e30>] ? gs_change+0x13/0x13
[ 44.210618] Code: 4d b8 44 89 4d b0 4c 89 55 a8 4c 89 ef e8 39 b4 ff ff 8b 4d b8 48 85 c0 44 8b 4d b0 4c 8b 55 a8 0f 84 7d 03 00 00 0f 1f 44 00 00 <f0> ff 80 98 01 00 00 8b 15 27 f2 1c 04 44 8b b3 f0 08 00 00 85
[ 44.210618] RIP [<ffffffff811644b0>] __lock_acquire+0x110/0x4b0
[ 44.210618] RSP <ffff89519a519aa0>
[ 44.210618] ---[ end trace 8f6ca168297608b8 ]---


2012-06-22 12:08:04

by Herbert Xu

[permalink] [raw]
Subject: Re: crypto: gpf on boot with linux-next

On Fri, Jun 22, 2012 at 01:15:55PM +0200, Sasha Levin wrote:
> Hi all,
>
> I'm seeing the following panic when booting the latest linux-next kernel:

Oops, stupid thinko on my part. Can you see if the following patch
on top of linux-next fixes the issue?

diff --git a/crypto/algboss.c b/crypto/algboss.c
index 368a832..f97027e 100644
--- a/crypto/algboss.c
+++ b/crypto/algboss.c
@@ -48,7 +48,7 @@ struct cryptomgr_param {
char larval[CRYPTO_MAX_ALG_NAME];
char template[CRYPTO_MAX_ALG_NAME];

- struct completion completion;
+ struct completion *completion;

u32 otype;
u32 omask;
@@ -87,7 +87,7 @@ static int cryptomgr_probe(void *data)
crypto_tmpl_put(tmpl);

out:
- complete(&param->completion);
+ complete(param->completion);
kfree(param);
module_put_and_exit(0);
}
@@ -189,14 +189,13 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval)

memcpy(param->larval, larval->alg.cra_name, CRYPTO_MAX_ALG_NAME);

- init_completion(&param->completion);
+ param->completion = &larval->completion;

thread = kthread_run(cryptomgr_probe, param, "cryptomgr_probe");
if (IS_ERR(thread))
goto err_free_param;

- wait_for_completion_interruptible_timeout(&param->completion, 60 * HZ);
- complete_all(&larval->completion);
+ wait_for_completion_interruptible(&larval->completion);

return NOTIFY_STOP;


Thanks!
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2012-06-22 12:24:12

by Herbert Xu

[permalink] [raw]
Subject: Re: crypto: gpf on boot with linux-next

On Fri, Jun 22, 2012 at 08:07:55PM +0800, Herbert Xu wrote:
> On Fri, Jun 22, 2012 at 01:15:55PM +0200, Sasha Levin wrote:
> > Hi all,
> >
> > I'm seeing the following panic when booting the latest linux-next kernel:
>
> Oops, stupid thinko on my part. Can you see if the following patch
> on top of linux-next fixes the issue?

For the sake of bisectability I've folded this into the original
patch so you could just test the cryptodev tree.

Thanks,
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt