From: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
To: linux-crypto@vger.kernel.org, linux-samsung-soc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, vzapolskiy@gmail.com,
herbert@gondor.apana.org.au, naveenkrishna.ch@gmail.com,
cpgs@samsung.com, tomasz.figa@gmail.com
Subject: [PATCH 6/6 v2] crypto:s5p-sss: validate iv before memcpy
Date: Thu, 09 Jan 2014 10:30:40 +0530 [thread overview]
Message-ID: <1389243640-13282-1-git-send-email-ch.naveen@samsung.com> (raw)
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
next reply other threads:[~2014-01-09 5:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-09 5:00 Naveen Krishna Chatradhi [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1389243640-13282-1-git-send-email-ch.naveen@samsung.com \
--to=ch.naveen@samsung.com \
--cc=cpgs@samsung.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=naveenkrishna.ch@gmail.com \
--cc=tomasz.figa@gmail.com \
--cc=vzapolskiy@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®