Message ID | 1398681899-20782-6-git-send-email-ch.naveen@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-samsung-soc-owner@kernel.org> X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3A1D09F271 for <patchwork-linux-samsung-soc@patchwork.kernel.org>; Mon, 28 Apr 2014 10:49:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 61C2A20251 for <patchwork-linux-samsung-soc@patchwork.kernel.org>; Mon, 28 Apr 2014 10:49:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6354E201DD for <patchwork-linux-samsung-soc@patchwork.kernel.org>; Mon, 28 Apr 2014 10:49:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754884AbaD1Kso (ORCPT <rfc822;patchwork-linux-samsung-soc@patchwork.kernel.org>); Mon, 28 Apr 2014 06:48:44 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:64391 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932183AbaD1KrJ (ORCPT <rfc822;linux-samsung-soc@vger.kernel.org>); Mon, 28 Apr 2014 06:47:09 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N4Q00ECCLYHVTB0@mailout3.samsung.com>; Mon, 28 Apr 2014 19:47:05 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.123]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 9B.43.14563.9A13E535; Mon, 28 Apr 2014 19:47:05 +0900 (KST) X-AuditID: cbfee68e-b7fd86d0000038e3-92-535e31a9b2e4 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id DD.47.27725.8A13E535; Mon, 28 Apr 2014 19:47:05 +0900 (KST) Received: from chnaveen-ubuntu.sisodomain.com ([107.108.83.161]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N4Q0050BLXS1380@mmp2.samsung.com>; Mon, 28 Apr 2014 19:47:04 +0900 (KST) 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, t.figa@samsung.com, davem@davemloft.net Subject: [PATCH 5/7 v8] crypto:s5p-sss: validate iv before memcpy Date: Mon, 28 Apr 2014 16:14:57 +0530 Message-id: <1398681899-20782-6-git-send-email-ch.naveen@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1398681899-20782-1-git-send-email-ch.naveen@samsung.com> References: <1398681899-20782-1-git-send-email-ch.naveen@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLLMWRmVeSWpSXmKPExsWyRsSkWnelYVywwY+V3BYvD2lazDnfwmLR /UrG4v69n0wWl3fNYbOYcX4fk8Wibf+ZLdbPeM1icXbOISYHTo8tK28yeeycdZfdY9sBVY++ LasYPT5vkgtgjeKySUnNySxLLdK3S+DK6JmzmKngPEfFiT9PmRoYF7F3MXJySAiYSFze0csE YYtJXLi3nq2LkYtDSGApo8TsO1eZYIo2NF5ihEhMZ5Q4emABM0hCSKCfSeLaYi8Qm03ATOLg otVgU0UEnCV+N69hBWlgFljHKPHpzWGwScICjhK9fd9ZQGwWAVWJR5PngcV5BVwlNtz/CmRz AG1TkJgzyQYkzCngJnF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Q SCA9sSQ1OzW1ILUIZgsTB6dUA2P2rcvlx1QvZa4RV+w4xvnnJseqfwqF3HYBSTKfZ8tU+B1x XbeFxXfFYSXJ01lK2ybs27t0a23Ih2PvvQPPXfygo/33XfeJslNG608Iih2ecODQrfwJLdHl x+3MbV2j72SqrLm18d6K2q54Ft6kc91muhEbqzUkjJNOlT9ckz8hWilh30e2t/JKLMUZiYZa zEXFiQCaVkuZ7QIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: <linux-samsung-soc.vger.kernel.org> X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index 37e0598..0ffc042 100644 --- a/drivers/crypto/s5p-sss.c +++ b/drivers/crypto/s5p-sss.c @@ -380,7 +380,8 @@ static void s5p_set_aes(struct s5p_aes_dev *dev, { void __iomem *keystart; - memcpy(dev->aes_ioaddr + SSS_REG_AES_IV_DATA(0), iv, 0x10); + if (iv) + memcpy(dev->aes_ioaddr + SSS_REG_AES_IV_DATA(0), iv, 0x10); if (keylen == AES_KEYSIZE_256) keystart = dev->aes_ioaddr + SSS_REG_AES_KEY_DATA(0);