aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorBryan Buckley <bryan.buckley@ti.com>2012-07-11 11:02:23 -0500
committerZiyann <jaraidaniel@gmail.com>2014-10-01 12:58:50 +0200
commitff110b3dbbac3bedbbe48860044b03f27948109a (patch)
treefd8bcf25e3cedfb8ba8690957f58f56af87c4735 /security
parent4239f46b8b7e3a05478872df4f0143b6b645076a (diff)
downloadkernel_samsung_tuna-ff110b3dbbac3bedbbe48860044b03f27948109a.zip
kernel_samsung_tuna-ff110b3dbbac3bedbbe48860044b03f27948109a.tar.gz
kernel_samsung_tuna-ff110b3dbbac3bedbbe48860044b03f27948109a.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;
}