diff options
author | Ruchika Gupta <ruchika.gupta@freescale.com> | 2014-11-10 07:57:15 (GMT) |
---|---|---|
committer | Matthew Weigel <Matthew.Weigel@freescale.com> | 2014-12-11 18:40:36 (GMT) |
commit | 4ee736164db39f7bb2bdfb5c6a8ebf060031b8bf (patch) | |
tree | 94c825d788081e41810c7f8a9800af8a30d5fbab /drivers/crypto | |
parent | 6ac3ce019e2851d7680c025b36ec7ba6e4db55ec (diff) | |
download | linux-fsl-qoriq-4ee736164db39f7bb2bdfb5c6a8ebf060031b8bf.tar.xz |
crypto:caam: Initialize sec4_sg_bytes to 0 in ahash_final_no_ctx
In function, ahash_final_no_ctx space is allocated for base edesc
and hw desc commands, link tables. After SEC has finished executing
the descriptor, ahash_unmap is called. In this function, unmapping
of sec_sg_dma is done on the basis of variable sec4_sg_bytes in edesc.
Since sec4_sg_bytes was not initialized when edesc was allocated,
this results in kernel crash.
caam algorithms registered in /proc/crypto
Unable to handle kernel paging request at virtual address 7f5d8000
pgd = 80003000
[7f5d8000] *pgd=80000080005003, *pmd=00000000
Internal error: Oops: 206 [#1] SMP THUMB2
Modules linked in:
CPU: 0 PID: 96 Comm: cryptomgr_test Not tainted 3.12.19-rt30+ls1+gd62899c9b13f #4
task: ef1b7480 ti: cf98a000 task.ti: cf98a000
PC is at dma_cache_maint_page+0x3c/0xd4
LR is at __dma_page_dev_to_cpu+0x19/0x80
pc : [<8001285c>] lr : [<80012951>] psr: b0000133
sp : cf98b9b0 ip : 80012c09 fp : 7f5d8000
r10: 00000014 r9 : 8053f2c0 r8 : 804e0f04
r7 : 00000001 r6 : 00004000 r5 : 80558000 r4 : 24940000
r3 : 805215c0 r2 : ff080000 r1 : 00000340 r0 : 80558000
Flags: NzCV IRQs on FIQs on Mode SVC_32 ISA Thumb Segment kernel
Control: 70c53c7d Table: 80003000 DAC: f45b2700
Process cryptomgr_test (pid: 96, stack limit = 0xcf98a248)
Stack: (0xcf98b9b0 to 0xcf98c000)
b9a0: 00000001 24940000 00000014 7f5d8000
b9c0: 00000001 cf8adc00 cf912000 00000014 00000000 80012951 8001514d 00000014
b9e0: 81579080 80012c09 80012c09 00000000 cf8adc00 80249d89 00000000 00210020
ba00: 00000000 40000193 81573b80 802f96c5 00000001 800302f5 cf98bd6c cf98bcfc
ba20: 00000000 cf98bd6c cf98bd00 cf98bd68 00000003 00000000 00000001 8002e021
ba40: 0000001c 0000001c 000cf912 00000001 804e0f04 80012879 00000001 0000001c
ba60: 00000040 80f4a240 00000001 cf8d3c00 000014b4 00000109 cf8d3c00 81578c44
ba80: 00000001 81579080 cf8d3c00 802877ad 804d9c44 cf8d3c00 0000010a 80244945
baa0: 00000000 80012879 cf912040 cf98bcf0 81578e00 0000010a cf8d3cc0 0000003f
bac0: 00001360 81578c44 81574180 0000012c 81574188 ffff8c3a 0000003f 80522e44
bae0: 00000001 802883d1 80288351 0000000c 00000020 00000020 000cf912 00000001
bb00: 804e0f04 80012879 00000001 00000020 00000018 80f4a240 00000001 cf8d3c00
bb20: 000014f0 0000010c 00000860 80012951 cf8d3c00 0000010d 00000001 81579080
bb40: cf8d3c00 80249cf1 0000010c 802449ff 00000000 81573b80 cf912018 cf8adc00
bb60: 81578e00 0000010d cf8d3cc0 0000003f 802f7d9c 81578c44 81574180 0000012c
bb80: 81574188 ffff8c3a 0000003f 80522e44 00000001 802883d1 80288351 0000000c
bba0: 00000001 cf98a000 cf98a000 00000003 804d80c0 00000100 80523c40 8001b07f
bbc0: 802f7da2 00000000 0000000a 00208040 ffff8c39 00000000 cf98a018 40000193
bbe0: 804d3e3c 00000000 cf98bc64 cf98a018 804d4b80 cf98a000 804deb60 8001b185
bc00: cf98a008 8001b6b5 00000087 8000ca01 f0002000 cf98bc30 804decdc 800083e3
bc20: 802f7da2 00000133 ffffffff 802f9a9b 00000000 00000000 00000001 00000000
bc40: 81573b80 cf98bdcc 00000000 cf98bc88 cf98a018 804d4b80 cf98a000 804deb60
bc60: 800128f5 cf98bc78 802f7d9d 802f7da2 00000133 ffffffff 00000001 00000000
bc80: cf98bcf4 00030002 00000014 00000014 802f8011 804d4b80 804e0f04 80012879
bca0: 00000050 00000050 000cf970 00000001 804e0f04 80012879 00000001 00000270
bcc0: 80f4ae00 800128f5 00000000 804e0f04 00000040 5c200014 00000033 80012915
bce0: 00000020 ef1b7480 cf98bdcc cf98bdc8 cf98bd08 cf98bd5c cf98a000 00000001
bd00: 00000001 802f8011 7fffffff 7fffffff cf98bd50 802f75c3 cf8d3c80 010d010c
bd20: 00000001 802447a1 0000010d cf8d3c00 cf98bdcc 00010000 ef1b7480 7fffffff
bd40: cf98bdcc cf98bdc8 cf98bd50 802f8283 cf912018 00000001 00000000 ef1b7480
bd60: cf98bddc cf98bddc 00000002 cf98bdc8 804f6b24 cf8486a0 cf98bd90 cf8efb80
bd80: 00000001 cf98bdc8 00000000 802f82db cf970000 80136d85 cf8adc00 80137097
bda0: ef07d308 ef1b74c8 804f6b3d 0000000e ef07d308 00000000 cf8b69c0 804f6b24
bdc0: 00000007 00000000 00000000 00010001 dead4ead ffffffff ffffffff cf98bd60
bde0: cf98bd60 00000000 cf965000 cf964000 cf963000 cf962000 cf961000 cf960000
be00: cf95f000 cf95e000 80f4aca2 00000000 00000008 00000000 80f4abc2 00000e90
be20: 0000000e cf95ee90 00000000 804e0f04 00000000 5c200014 00000000 80012915
be40: 80015141 80f4ae00 00000270 cf970000 cf911010 80249423 00000001 00000000
be60: 8054abc8 000c000b 04410000 00000014 cf848638 00000000 cf970000 cf970040
be80: cf848638 ef36b780 0000008a cf970000 00000000 00000007 804f6b24 ef36b7c0
bea0: 00000400 00000064 00000000 801371db 00000000 804f6b24 00000007 cf970000
bec0: 80313bac 00000000 ffffffff 80137249 ef36b780 80137209 0000008a 80136d0d
bee0: e7fddef0 e7fddef0 e7fddef0 e7fddef0 e7fddef0 e7fddef0 e7fddef0 e7fddef0
bf00: e7fddef0 e7fddef0 e7fddef0 e7fddef0 00000001 ef081e08 ef081e04 ef1b7480
bf20: 00000000 ef36b780 00000000 ef36b780 801352d5 00000000 00000000 00000000
bf40: 00000000 801352ed ef081df4 80029395 e7fddef0 00000000 e7fddef0 ef36b780
bf60: 00000000 00000000 dead4ead ffffffff ffffffff cf98bf74 cf98bf74 00000000
bf80: 00000000 dead4ead ffffffff ffffffff cf98bf90 cf98bf90 00000000 ef081df4
bfa0: 80029339 00000000 00000000 8000c1d9 00000000 00000000 00000000 00000000
bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 e7fddef0 e7fddef0
[<8001285c>] (dma_cache_maint_page+0x3c/0xd4) from [<80012951>] (__dma_page_dev_to_cpu+0x19/0x80)
[<80012951>] (__dma_page_dev_to_cpu+0x19/0x80) from [<80249d89>] (ahash_done+0x99/0xb8)
[<80249d89>] (ahash_done+0x99/0xb8) from [<802449ff>] (caam_jr_dequeue+0x163/0x178)
[<802449ff>] (caam_jr_dequeue+0x163/0x178) from [<802883d1>] (net_rx_action+0x81/0x114)
[<802883d1>] (net_rx_action+0x81/0x114) from [<8001b07f>] (__do_softirq+0x8b/0x128)
[<8001b07f>] (__do_softirq+0x8b/0x128) from [<8001b185>] (do_softirq+0x31/0x3c)
[<8001b185>] (do_softirq+0x31/0x3c) from [<8001b6b5>] (irq_exit+0x4f/0x8e)
[<8001b6b5>] (irq_exit+0x4f/0x8e) from [<8000ca01>] (handle_IRQ+0x41/0x60)
[<8000ca01>] (handle_IRQ+0x41/0x60) from [<800083e3>] (gic_handle_irq+0x2b/0x44)
[<800083e3>] (gic_handle_irq+0x2b/0x44) from [<802f9a9b>] (__irq_svc+0x3b/0x5c)
Exception stack(0xcf98bc30 to 0xcf98bc78)
bc20: 00000000 00000000 00000001 00000000
bc40: 81573b80 cf98bdcc 00000000 cf98bc88 cf98a018 804d4b80 cf98a000 804deb60
bc60: 800128f5 cf98bc78 802f7d9d 802f7da2 00000133 ffffffff
[<802f9a9b>] (__irq_svc+0x3b/0x5c) from [<802f7da2>] (__schedule+0x36/0x24c)
[<802f7da2>] (__schedule+0x36/0x24c) from [<802f8011>] (schedule+0x59/0x6c)
[<802f8011>] (schedule+0x59/0x6c) from [<802f75c3>] (schedule_timeout+0x13/0x100)
[<802f75c3>] (schedule_timeout+0x13/0x100) from [<802f8283>] (wait_for_common+0x9b/0xc4)
[<802f8283>] (wait_for_common+0x9b/0xc4) from [<802f82db>] (wait_for_completion_interruptible+0xf/0x20)
[<802f82db>] (wait_for_completion_interruptible+0xf/0x20) from [<80136d85>] (do_one_async_hash_op.isra.5+0x19/0x22)
[<80136d85>] (do_one_async_hash_op.isra.5+0x19/0x22) from [<80137097>] (__test_hash+0x309/0x3ae)
[<80137097>] (__test_hash+0x309/0x3ae) from [<801371db>] (test_hash+0x17/0x44)
[<801371db>] (test_hash+0x17/0x44) from [<80137249>] (alg_test_hash+0x41/0x54)
[<80137249>] (alg_test_hash+0x41/0x54) from [<80136d0d>] (alg_test+0x129/0x188)
[<80136d0d>] (alg_test+0x129/0x188) from [<801352ed>] (cryptomgr_test+0x19/0x34)
[<801352ed>] (cryptomgr_test+0x19/0x34) from [<80029395>] (kthread+0x5d/0x6c)
[<80029395>] (kthread+0x5d/0x6c) from [<8000c1d9>] (ret_from_fork+0x11/0x38)
Code: 3212 0152 eb00 0b02 (5882) 0f92
---[ end trace 3a9625077c8d21fb ]---
Kernel panic - not syncing: Fatal exception in interrupt
CPU1: stopping
CPU: 1 PID: 0 Comm: swapper/1 Tainted: G D 3.12.19-rt30+ls1+gd62899c9b13f #4
[<800107d9>] (unwind_backtrace+0x1/0x88) from [<8000e4ef>] (show_stack+0xb/0xc)
[<8000e4ef>] (show_stack+0xb/0xc) from [<802f6dbd>] (dump_stack+0x4d/0x60)
[<802f6dbd>] (dump_stack+0x4d/0x60) from [<8000fee3>] (handle_IPI+0x7f/0xbc)
[<8000fee3>] (handle_IPI+0x7f/0xbc) from [<800083f3>] (gic_handle_irq+0x3b/0x44)
[<800083f3>] (gic_handle_irq+0x3b/0x44) from [<802f9a9b>] (__irq_svc+0x3b/0x5c)
Exception stack(0xef09bfa0 to 0xef09bfe8)
bfa0: ffffffed 00000000 010a7000 00000000 ef09a000 ef09a010 80000000 80523390
bfc0: 80003010 410fc075 00000000 00000000 00000008 ef09bfe8 8000cbd1 8000cbd2
bfe0: 60000133 ffffffff
[<802f9a9b>] (__irq_svc+0x3b/0x5c) from [<8000cbd2>] (arch_cpu_idle+0x1a/0x20)
[<8000cbd2>] (arch_cpu_idle+0x1a/0x20) from [<8003a285>] (cpu_startup_entry+0x7d/0xc4)
[<8003a285>] (cpu_startup_entry+0x7d/0xc4) from [<80008485>] (__enable_mmu+0x1/0x1c)
Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
Change-Id: I1bcaa5a402409a943b47d7e7b3672a081d934a24
Reviewed-on: http://git.am.freescale.net:8181/23427
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com>
Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/caam/caamhash.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index 7728119..2cfa3ba 100644 --- a/drivers/crypto/caam/caamhash.c +++ b/drivers/crypto/caam/caamhash.c @@ -1199,6 +1199,7 @@ static int ahash_final_no_ctx(struct ahash_request *req) return -ENOMEM; } edesc->src_nents = 0; + edesc->sec4_sg_bytes = 0; #ifdef DEBUG print_hex_dump(KERN_ERR, "jobdesc@"__stringify(__LINE__)": ", |