Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7710445ybi; Wed, 5 Jun 2019 23:46:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYgVKavHFj5nvxNyDmOZ/u3tM2y7zmn17ewp5+mFpyuSxnbNbSqbN2b1HDQ5rGLhgab+op X-Received: by 2002:a63:5b5d:: with SMTP id l29mr1949673pgm.444.1559803587768; Wed, 05 Jun 2019 23:46:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559803587; cv=none; d=google.com; s=arc-20160816; b=usYbpZrWeQBpxc6JkS9ib9amINysFcIEDCshAjE5lEAjxxl0lDDt8GvzhqW056pKSD hxBl5uyysaFKqDTQfgouNWBLX1bXxPPQt/ReLPkhQKcyfF8KiNC1KtWyIpuBAI/xQIDE 159pka/duZTjTPWwgFnaH1Dhf7c+twftq04lEQ1zQbI9cyAkUC2NkI+CLTDiV6sMRLfc 2WdwfGCpVbOSNCs5FwFkZC7Hk6dFzhPvm/rBEV/npaMpUAK3yakqHkr+SUMcCI0IzSqL VJInKgijuSoZy3OeJftjXR3Vx+gDMGSy/t/zAq9pP9R0lUZdRAAvhZS6fj03I872S571 WueA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=rJ1lMTXMQgrEX/dgE8NddRjDUuYluBMlXEnN5SkBJyY=; b=PA1K2YS1oQkKuSti/PjAkH2jIDXA8Nx62J5w7Fo6N9Gp1OXVG7BA/HsPFNcwOM6ZmU WsO9LmsbKRxOYNi9PxZCG0hWkLZ/WV8Q1oCUoVuQqJ8GqqbWKPfSgXUKwHSMgrfTjisw 2iwV9R2OfbbtjMNbUf3/vpKBd44LcMZ3YiG9UKTpefANCgHJxsmLnqFpMgiKrnjFchhw sjWS/1YBJyvVXtXNh/mFGSxK2dafwG7ZfwwU5goH/ql49fpZ2tH9ZKGX3SPtjST3U4tc EmL8lfirgCrkfCBAmFoZZIQNgGpqL4W4BTe3s70Ko7pL3smWk8aeiTmViYmZIoRchVhX R4uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si1042870pld.91.2019.06.05.23.46.13; Wed, 05 Jun 2019 23:46:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725769AbfFFGqM (ORCPT + 99 others); Thu, 6 Jun 2019 02:46:12 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:38340 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725267AbfFFGqL (ORCPT ); Thu, 6 Jun 2019 02:46:11 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1hYmA2-0006kp-Td; Thu, 06 Jun 2019 14:46:06 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1hYm9z-0005LB-QE; Thu, 06 Jun 2019 14:46:03 +0800 Date: Thu, 6 Jun 2019 14:46:03 +0800 From: Herbert Xu To: Ard Biesheuvel Cc: Iuliana Prodan , Eric Biggers , "David S. Miller" , Horia Geanta , Sascha Hauer , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Linux Kernel Mailing List , dl-linux-imx Subject: Re: [PATCH] crypto: gcm - fix cacheline sharing Message-ID: <20190606064603.lvde6dproqi3vwcq@gondor.apana.org.au> References: <20190530133427.qrwjzctac2x6nsby@gondor.apana.org.au> <20190530142734.qlhgzeal22zxfhk5@gondor.apana.org.au> <20190606063724.n77z7gaf32tmyxng@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Jun 06, 2019 at 08:42:46AM +0200, Ard Biesheuvel wrote: > On Thu, 6 Jun 2019 at 08:37, Herbert Xu wrote: > > > > On Thu, May 30, 2019 at 04:31:09PM +0200, Ard Biesheuvel wrote: > > > > > > This might work: > > > > > > diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c > > > index c0ece44f303b..3d313d2a279a 100644 > > > --- a/drivers/crypto/caam/caamalg.c > > > +++ b/drivers/crypto/caam/caamalg.c > > > @@ -1661,7 +1661,8 @@ static int aead_decrypt(struct aead_request *req) > > > * allocate and map the skcipher extended descriptor for skcipher > > > */ > > > static struct skcipher_edesc *skcipher_edesc_alloc(struct > > > skcipher_request *req, > > > - int desc_bytes) > > > + int desc_bytes, > > > + u8 const *input_iv) > > > { > > > struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req); > > > struct caam_ctx *ctx = crypto_skcipher_ctx(skcipher); > > > @@ -1745,7 +1746,7 @@ static struct skcipher_edesc > > > *skcipher_edesc_alloc(struct skcipher_request *req, > > > /* Make sure IV is located in a DMAable area */ > > > if (ivsize) { > > > iv = (u8 *)edesc->hw_desc + desc_bytes + sec4_sg_bytes; > > > - memcpy(iv, req->iv, ivsize); > > > + memcpy(iv, input_iv, ivsize); > > > > > > iv_dma = dma_map_single(jrdev, iv, ivsize, DMA_TO_DEVICE); > > > if (dma_mapping_error(jrdev, iv_dma)) { > > > > Hi Ard: > > > > I presume you will be submitting this patch at some point? When > > you do please base it on top of your other one which I'm about to > > merge. > > I'm not sure I follow. Do you want a better fix for the CBC output IV > going forward? Or is this about other modes? You sent me a patch to fix CTR mode: https://patchwork.kernel.org/patch/10969747/ But your suggested fix for CBC mode itself where we need to do the copy (as seen quoted above) hasn't been submitted. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt