aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorBryan Buckley <bryan.buckley@ti.com>2012-07-11 11:02:23 -0500
committerDmytro Kedrovskyi <x0169235@ti.com>2012-07-18 18:23:22 +0300
commit7e573ba1d7f74ddd1089441fec79e68ac6719d94 (patch)
tree2e307450de9f30e1a65810d1c479bc7f87b2f89b /security
parent053a17e8f0a4d8c24f849f75b83284c79f1a6ecf (diff)
downloadkernel_samsung_espresso10-7e573ba1d7f74ddd1089441fec79e68ac6719d94.zip
kernel_samsung_espresso10-7e573ba1d7f74ddd1089441fec79e68ac6719d94.tar.gz
kernel_samsung_espresso10-7e573ba1d7f74ddd1089441fec79e68ac6719d94.tar.bz2
SMC: Unlock aes_hwa_ctx lock in case of bad dma_map_sg
This release of the SMC package fixes PL310 accesses (See MSDK273 from MSHIELD) In case of bad dma_map_sg, we silently fail. Be sure to call spin_unlock_irqrestore before silently failing. Change-Id: Ib6015c0710e56eae2bce341f263d62142f12ba3e Signed-off-by: Bryan Buckley <bryan.buckley@ti.com>
Diffstat (limited to 'security')
-rw-r--r--security/smc/s_version.h2
-rw-r--r--security/smc/tf_crypto_aes.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/security/smc/s_version.h b/security/smc/s_version.h
index 68453ac..2818e19 100644
--- a/security/smc/s_version.h
+++ b/security/smc/s_version.h
@@ -45,7 +45,7 @@
* defines to set the version number. Else set these values to 0.
*/
#define S_VERSION_ENG 0
-#define S_VERSION_PATCH 4
+#define S_VERSION_PATCH 6
#ifdef S_VERSION_BUILD
/* TRICK: detect if S_VERSION is defined but empty */
diff --git a/security/smc/tf_crypto_aes.c b/security/smc/tf_crypto_aes.c
index fb744b1..821bdea 100644
--- a/security/smc/tf_crypto_aes.c
+++ b/security/smc/tf_crypto_aes.c
@@ -838,14 +838,17 @@ static int aes_dma_start(struct aes_hwa_ctx *ctx)
if (!(ctx->next_req->flags & CRYPTO_TFM_REQ_DMA_VISIBLE)) {
err = dma_map_sg(NULL, req->src, 1, DMA_TO_DEVICE);
- if (!err)
+ if (!err) {
/* Silently fail for now... */
+ spin_unlock_irqrestore(&ctx->lock, flags);
return 0;
+ }
err = dma_map_sg(NULL, req->dst, 1, DMA_FROM_DEVICE);
if (!err) {
dma_unmap_sg(NULL, req->src, 1, DMA_TO_DEVICE);
/* Silently fail for now... */
+ spin_unlock_irqrestore(&ctx->lock, flags);
return 0;
}