Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933936Ab3HGXQB (ORCPT ); Wed, 7 Aug 2013 19:16:01 -0400 Received: from e9.ny.us.ibm.com ([32.97.182.139]:53673 "EHLO e9.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933755Ab3HGXP6 (ORCPT ); Wed, 7 Aug 2013 19:15:58 -0400 Message-ID: <1375917350.16050.14.camel@what-is-leg> Subject: [PATCH v2] drivers/crypto/nx: saves chaining value from co-processor From: Fionnuala Gunter To: linux-kernel@vger.kernel.org Cc: linux-crypto@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, herbert@gondor.hengli.com.au, fin@linux.vnet.ibm.com, mhcerri@linux.vnet.ibm.com Date: Wed, 07 Aug 2013 18:15:50 -0500 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.6.2-0ubuntu0.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13080723-7182-0000-0000-00000802B33F Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1356 Lines: 40 This patch fixes a bug that is triggered when cts(cbc(aes)) is used with nx-crypto driver on input larger than 32 bytes. The chaining value from co-processor was not being saved. This value is needed because it is used as the IV by cts(cbc(aes)). Signed-off-by: Fionnuala Gunter Reviewed-by: Marcelo Cerri --- v2. changed signed-off-by to reviewed-by and added more details to description This bug appeared in the original submission (v3.5) --- drivers/crypto/nx/nx-aes-cbc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/nx/nx-aes-cbc.c b/drivers/crypto/nx/nx-aes-cbc.c index 35d483f..a2f99a9 100644 --- a/drivers/crypto/nx/nx-aes-cbc.c +++ b/drivers/crypto/nx/nx-aes-cbc.c @@ -95,6 +95,7 @@ static int cbc_aes_nx_crypt(struct blkcipher_desc *desc, if (rc) goto out; + memcpy(desc->info, csbcpb->cpb.aes_cbc.cv, AES_BLOCK_SIZE); atomic_inc(&(nx_ctx->stats->aes_ops)); atomic64_add(csbcpb->csb.processed_byte_count, &(nx_ctx->stats->aes_bytes)); -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/