Re: [PATCH 1/2] crypto: caamhash: - fix uninitialized edesc->sec4_sg_bytes field

2015-03-06 Thread Kim Phillips
On Fri, 6 Mar 2015 10:34:41 +0800
 wrote:

> From: Yanjiang Jin 
> 
> sec4_sg_bytes not being properly initialized causes ahash_done
> to try to free unallocated DMA memory:
> 
> caam_jr ffe301000.jr: DMA-API: device driver tries to free DMA memory it has 
> not allocated [device address=0xdeadbeefdeadbeef] [size=3735928559 bytes]
> [ cut here ]
> WARNING: at lib/dma-debug.c:1093
> Modules linked in:
> CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.0.0-rc1+ #6
> task: e9598c00 ti: effca000 task.ti: e95a2000
> NIP: c04ef24c LR: c04ef24c CTR: c0549730
> REGS: effcbd40 TRAP: 0700   Not tainted  (4.0.0-rc1+)
> MSR: 00029002   CR: 22008084  XER: 2000
> 
> GPR00: c04ef24c effcbdf0 e9598c00 0096 c08f7424 c00ab2b0  0001
> GPR08: c0fe7510 effca000  01c3 22008082  c1048e77 c105
> GPR16: c0c36700 493c0040 002c e690e4a0 c1054fb4 c18bac40 00029002 c18b0788
> GPR24: 0014 e690e480 effcbe48  c0fde128 e6ffac10 deadbeef deadbeef
> NIP [c04ef24c] check_unmap+0x93c/0xb40
> LR [c04ef24c] check_unmap+0x93c/0xb40
> Call Trace:
> [effcbdf0] [c04ef24c] check_unmap+0x93c/0xb40 (unreliable)
> [effcbe40] [c04ef4f4] debug_dma_unmap_page+0xa4/0xc0
> [effcbec0] [c070cda8] ahash_done+0x128/0x1a0
> [effcbef0] [c0700070] caam_jr_dequeue+0x1d0/0x290
> [effcbf40] [c0045f40] tasklet_action+0x110/0x1f0
> [effcbf80] [c0044bc8] __do_softirq+0x188/0x700
> [effcbfe0] [c00455d8] irq_exit+0x108/0x120
> [effcbff0] [c000f520] call_do_irq+0x24/0x3c
> [e95a3e20] [c00059b8] do_IRQ+0xc8/0x170
> [e95a3e50] [c0011bc8] ret_from_except+0x0/0x18
> 
> Signed-off-by: Yanjiang Jin 
> ---

Acked-by: Kim Phillips 

Thanks,

Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] crypto: caamhash: - fix uninitialized edesc-sec4_sg_bytes field

2015-03-06 Thread Kim Phillips
On Fri, 6 Mar 2015 10:34:41 +0800
yanjiang@windriver.com wrote:

 From: Yanjiang Jin yanjiang@windriver.com
 
 sec4_sg_bytes not being properly initialized causes ahash_done
 to try to free unallocated DMA memory:
 
 caam_jr ffe301000.jr: DMA-API: device driver tries to free DMA memory it has 
 not allocated [device address=0xdeadbeefdeadbeef] [size=3735928559 bytes]
 [ cut here ]
 WARNING: at lib/dma-debug.c:1093
 Modules linked in:
 CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.0.0-rc1+ #6
 task: e9598c00 ti: effca000 task.ti: e95a2000
 NIP: c04ef24c LR: c04ef24c CTR: c0549730
 REGS: effcbd40 TRAP: 0700   Not tainted  (4.0.0-rc1+)
 MSR: 00029002 CE,EE,ME  CR: 22008084  XER: 2000
 
 GPR00: c04ef24c effcbdf0 e9598c00 0096 c08f7424 c00ab2b0  0001
 GPR08: c0fe7510 effca000  01c3 22008082  c1048e77 c105
 GPR16: c0c36700 493c0040 002c e690e4a0 c1054fb4 c18bac40 00029002 c18b0788
 GPR24: 0014 e690e480 effcbe48  c0fde128 e6ffac10 deadbeef deadbeef
 NIP [c04ef24c] check_unmap+0x93c/0xb40
 LR [c04ef24c] check_unmap+0x93c/0xb40
 Call Trace:
 [effcbdf0] [c04ef24c] check_unmap+0x93c/0xb40 (unreliable)
 [effcbe40] [c04ef4f4] debug_dma_unmap_page+0xa4/0xc0
 [effcbec0] [c070cda8] ahash_done+0x128/0x1a0
 [effcbef0] [c0700070] caam_jr_dequeue+0x1d0/0x290
 [effcbf40] [c0045f40] tasklet_action+0x110/0x1f0
 [effcbf80] [c0044bc8] __do_softirq+0x188/0x700
 [effcbfe0] [c00455d8] irq_exit+0x108/0x120
 [effcbff0] [c000f520] call_do_irq+0x24/0x3c
 [e95a3e20] [c00059b8] do_IRQ+0xc8/0x170
 [e95a3e50] [c0011bc8] ret_from_except+0x0/0x18
 
 Signed-off-by: Yanjiang Jin yanjiang@windriver.com
 ---

Acked-by: Kim Phillips kim.phill...@freescale.com

Thanks,

Kim
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] crypto: caamhash: - fix uninitialized edesc->sec4_sg_bytes field

2015-03-05 Thread yanjiang.jin
From: Yanjiang Jin 

sec4_sg_bytes not being properly initialized causes ahash_done
to try to free unallocated DMA memory:

caam_jr ffe301000.jr: DMA-API: device driver tries to free DMA memory it has 
not allocated [device address=0xdeadbeefdeadbeef] [size=3735928559 bytes]
[ cut here ]
WARNING: at lib/dma-debug.c:1093
Modules linked in:
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.0.0-rc1+ #6
task: e9598c00 ti: effca000 task.ti: e95a2000
NIP: c04ef24c LR: c04ef24c CTR: c0549730
REGS: effcbd40 TRAP: 0700   Not tainted  (4.0.0-rc1+)
MSR: 00029002   CR: 22008084  XER: 2000

GPR00: c04ef24c effcbdf0 e9598c00 0096 c08f7424 c00ab2b0  0001
GPR08: c0fe7510 effca000  01c3 22008082  c1048e77 c105
GPR16: c0c36700 493c0040 002c e690e4a0 c1054fb4 c18bac40 00029002 c18b0788
GPR24: 0014 e690e480 effcbe48  c0fde128 e6ffac10 deadbeef deadbeef
NIP [c04ef24c] check_unmap+0x93c/0xb40
LR [c04ef24c] check_unmap+0x93c/0xb40
Call Trace:
[effcbdf0] [c04ef24c] check_unmap+0x93c/0xb40 (unreliable)
[effcbe40] [c04ef4f4] debug_dma_unmap_page+0xa4/0xc0
[effcbec0] [c070cda8] ahash_done+0x128/0x1a0
[effcbef0] [c0700070] caam_jr_dequeue+0x1d0/0x290
[effcbf40] [c0045f40] tasklet_action+0x110/0x1f0
[effcbf80] [c0044bc8] __do_softirq+0x188/0x700
[effcbfe0] [c00455d8] irq_exit+0x108/0x120
[effcbff0] [c000f520] call_do_irq+0x24/0x3c
[e95a3e20] [c00059b8] do_IRQ+0xc8/0x170
[e95a3e50] [c0011bc8] ret_from_except+0x0/0x18

Signed-off-by: Yanjiang Jin 
---
Same as v2.

 drivers/crypto/caam/caamhash.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c
index f347ab7..ba0532e 100644
--- a/drivers/crypto/caam/caamhash.c
+++ b/drivers/crypto/caam/caamhash.c
@@ -1172,6 +1172,7 @@ static int ahash_final_no_ctx(struct ahash_request *req)
return -ENOMEM;
}
 
+   edesc->sec4_sg_bytes = 0;
sh_len = desc_len(sh_desc);
desc = edesc->hw_desc;
init_job_desc_shared(desc, ptr, sh_len, HDR_SHARE_DEFER | HDR_REVERSE);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] crypto: caamhash: - fix uninitialized edesc-sec4_sg_bytes field

2015-03-05 Thread yanjiang.jin
From: Yanjiang Jin yanjiang@windriver.com

sec4_sg_bytes not being properly initialized causes ahash_done
to try to free unallocated DMA memory:

caam_jr ffe301000.jr: DMA-API: device driver tries to free DMA memory it has 
not allocated [device address=0xdeadbeefdeadbeef] [size=3735928559 bytes]
[ cut here ]
WARNING: at lib/dma-debug.c:1093
Modules linked in:
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.0.0-rc1+ #6
task: e9598c00 ti: effca000 task.ti: e95a2000
NIP: c04ef24c LR: c04ef24c CTR: c0549730
REGS: effcbd40 TRAP: 0700   Not tainted  (4.0.0-rc1+)
MSR: 00029002 CE,EE,ME  CR: 22008084  XER: 2000

GPR00: c04ef24c effcbdf0 e9598c00 0096 c08f7424 c00ab2b0  0001
GPR08: c0fe7510 effca000  01c3 22008082  c1048e77 c105
GPR16: c0c36700 493c0040 002c e690e4a0 c1054fb4 c18bac40 00029002 c18b0788
GPR24: 0014 e690e480 effcbe48  c0fde128 e6ffac10 deadbeef deadbeef
NIP [c04ef24c] check_unmap+0x93c/0xb40
LR [c04ef24c] check_unmap+0x93c/0xb40
Call Trace:
[effcbdf0] [c04ef24c] check_unmap+0x93c/0xb40 (unreliable)
[effcbe40] [c04ef4f4] debug_dma_unmap_page+0xa4/0xc0
[effcbec0] [c070cda8] ahash_done+0x128/0x1a0
[effcbef0] [c0700070] caam_jr_dequeue+0x1d0/0x290
[effcbf40] [c0045f40] tasklet_action+0x110/0x1f0
[effcbf80] [c0044bc8] __do_softirq+0x188/0x700
[effcbfe0] [c00455d8] irq_exit+0x108/0x120
[effcbff0] [c000f520] call_do_irq+0x24/0x3c
[e95a3e20] [c00059b8] do_IRQ+0xc8/0x170
[e95a3e50] [c0011bc8] ret_from_except+0x0/0x18

Signed-off-by: Yanjiang Jin yanjiang@windriver.com
---
Same as v2.

 drivers/crypto/caam/caamhash.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c
index f347ab7..ba0532e 100644
--- a/drivers/crypto/caam/caamhash.c
+++ b/drivers/crypto/caam/caamhash.c
@@ -1172,6 +1172,7 @@ static int ahash_final_no_ctx(struct ahash_request *req)
return -ENOMEM;
}
 
+   edesc-sec4_sg_bytes = 0;
sh_len = desc_len(sh_desc);
desc = edesc-hw_desc;
init_job_desc_shared(desc, ptr, sh_len, HDR_SHARE_DEFER | HDR_REVERSE);
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/