linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 6/6 v2] crypto:s5p-sss: validate iv before memcpy
@ 2014-01-09  5:00 Naveen Krishna Chatradhi
  2014-01-10 11:45 ` [PATCH 7/8 v3] " Naveen Krishna Chatradhi
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Naveen Krishna Chatradhi @ 2014-01-09  5:00 UTC (permalink / raw)
  To: linux-crypto, linux-samsung-soc
  Cc: linux-kernel, vzapolskiy, herbert, naveenkrishna.ch, cpgs,
	tomasz.figa

This patch adds code to validate "iv" buffer before trying to
memcpy the contents

Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
---
Changes since v1:
None

 drivers/crypto/s5p-sss.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c
index 7c31a5f..220f123 100644
--- a/drivers/crypto/s5p-sss.c
+++ b/drivers/crypto/s5p-sss.c
@@ -398,8 +398,9 @@ static void s5p_set_aes(struct s5p_aes_dev *dev,
 	struct samsung_aes_varient *var = dev->varient;
 	void __iomem *keystart;
 
-	memcpy(dev->ioaddr + SSS_REG_AES_IV_DATA
-				(var->aes_offset, 0), iv, 0x10);
+	if (iv)
+		memcpy(dev->ioaddr + SSS_REG_AES_IV_DATA
+					(var->aes_offset, 0), iv, 0x10);
 
 	if (keylen == AES_KEYSIZE_256)
 		keystart = dev->ioaddr +
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-02-07  5:25 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-09  5:00 [PATCH 6/6 v2] crypto:s5p-sss: validate iv before memcpy Naveen Krishna Chatradhi
2014-01-10 11:45 ` [PATCH 7/8 v3] " Naveen Krishna Chatradhi
2014-01-10 16:03   ` Tomasz Figa
2014-01-15  6:45     ` Naveen Krishna Ch
2014-01-15  9:16 ` [PATCH 6/8 v4] ARM: dts: exynos5250/5420: add dt node for sss module Naveen Krishna Chatradhi
2014-01-23 10:19   ` Naveen Krishna Ch
2014-01-24 15:36   ` Tomasz Figa
2014-01-29  9:24   ` [PATCH 6/9 v5] " Naveen Krishna Chatradhi
2014-01-15  9:17 ` [PATCH 7/8 v4] crypto:s5p-sss: validate iv before memcpy Naveen Krishna Chatradhi
2014-01-23 10:18   ` Naveen Krishna Ch
2014-01-24 15:52   ` Tomasz Figa
2014-01-29  9:25 ` [PATCH 7/9 v5] " Naveen Krishna Chatradhi
2014-02-07  5:25 ` [PATCH 7/9 v6] " Naveen Krishna Chatradhi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).