Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp278004ybt; Mon, 6 Jul 2020 09:06:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJ3NUQ8wDaI9J7EGOiX6Df9FGxn64I0UoCLXa+jVaa4RLpr7VaaDVn6w/26fJgI23j329O X-Received: by 2002:a05:6402:1c07:: with SMTP id ck7mr44998562edb.297.1594051578780; Mon, 06 Jul 2020 09:06:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594051578; cv=none; d=google.com; s=arc-20160816; b=SpkrcBiVysxap3IHt4vzXiIWm+uI721BbNNA9lbVCIUtTWWvUYpPJ0Fh34q+JaMAJe Dg8P9dNRxLSDDVuiAksSW3ePgjHbSRPaDAeiqHDR5+WT/v+HTKxeKVSPIZKC5LzdnMCA jABdnvgrNYZ5RMfKht1MbBMCk7X0OuM7Lah8fU6R5ADyz5Bz7uQ71nvgj95A46tzAkW/ 4+OUem0q4Qf5+4xAdaaTJnfBiBMJJIEVAF1bt47vSUHnuHQms4JInjfsuL14yznTXMVC HCe/hSz3ns2POMDRTeGXbyEbXYUYN9SO9EzTm9zueFjpqqAbUN2ed/+dptcEv2PWxcxp Z6/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=eBPnkwcEmj4IleOIZo1SbNNrAcrM3jMcjDLqnc3mvM4=; b=EuIW/EO1nNAe7OPNU4zyZvkgJOepEd368O6xfLp18q9cFvNw6I4IiWpYfAkoG/td5J 3SrjBGP7uAWOs/2m0mPHc76+fHggGCu8o/7eR5p6m+5IXHc29GgQqcpuhHHHsm2JP9BF KgjrKvDk+e9Y4zbDA6ps9yhVgGGbdZ1syTluvoAz0BMGq3Tq1l9TdzorbRK3WkUfzjXW fuUy/IUfVZMZU+/maBCyaSk2L39lw6XhkcrjrXpp2Fsojd/ml2FFhWIu3B6PRcezVDie iLc6SGK+T2RVg+9BLlJXqMOoxsuw6oduQFkiQMeWahy2LOS9gPYJSRNydTmu6D+z1B+W xC3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@jamieiles-com.20150623.gappssmtp.com header.s=20150623 header.b=graI+dI9; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o15si12862836eja.702.2020.07.06.09.05.46; Mon, 06 Jul 2020 09:06:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@jamieiles-com.20150623.gappssmtp.com header.s=20150623 header.b=graI+dI9; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729377AbgGFQFo (ORCPT + 99 others); Mon, 6 Jul 2020 12:05:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729293AbgGFQFn (ORCPT ); Mon, 6 Jul 2020 12:05:43 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52DFEC061755 for ; Mon, 6 Jul 2020 09:05:43 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id z15so30356060wrl.8 for ; Mon, 06 Jul 2020 09:05:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jamieiles-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=eBPnkwcEmj4IleOIZo1SbNNrAcrM3jMcjDLqnc3mvM4=; b=graI+dI9hBmdeMJXZyZgAWHjSt1hUmgm9LBS4QABqnLq8Lcgmjo8x9pfbg9lP9kf+n ZRVeDcsn9hAIG0hT9rbi261Fo2WwMjWP3CXuOG/sTJb5jtvLpzgM+1S3Cpxg3XpDDmhb wlFdSslM7AOFNgZWZOqoNNpUTgNxGbjoCxxtjmF5hWWpunSeKPWSKOiW9/R/dFzffatG rSgvWF5ft+ujntg8tbpzDWYlk+ZKQdfpoyPltv5wCMLSmdLVvMam28GoydknZ+DjHr/b n2dqdeadOzbuguOrHu+YB5et0IWZT5c2/rM9ajw4ooE6W5T4PguSYx3MknuIf1v6RPAh lyPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=eBPnkwcEmj4IleOIZo1SbNNrAcrM3jMcjDLqnc3mvM4=; b=JTPLJ0Zwjsk9gm7FIzI6gIdi83abMqXgyWdnzaFasf2R1rWDZnXA6LxAKNHYpJWb8o bbc6qHsNubCIWoYb1lR63cz8ALC+UhTapDV/LqVkvVofwyFiyO/rqKw7dyic9YDPUygr KcnUVNqGDfVW7gmuL3yzBGrpjZKpYczcPjhW+26pvm8VPVPfFmlcLlVja0fR7RVpExM3 NnFeuRgG4MkceaYcpmFFSRgOqdAbWnpa6Vbcf9+ckazET1Ro+z1gdRLJlPdxn0g+Kk8t EQ7Z7Y0031m+RiGesBbtgMStdebdfJNvM8EWXA7HctV3Z1oo2oJWkuS+jfX0BeZEW7d4 bm6Q== X-Gm-Message-State: AOAM533guf4uviOn5S6vmB1lv6n45cZ41ATayy/B1m420yqUdWdAUT3J J2wWRtpVDZ/+DuezgDuzVaXRFA== X-Received: by 2002:adf:f7cb:: with SMTP id a11mr46422170wrq.291.1594051542111; Mon, 06 Jul 2020 09:05:42 -0700 (PDT) Received: from localhost ([82.38.213.95]) by smtp.gmail.com with ESMTPSA id e17sm24137875wrr.88.2020.07.06.09.05.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2020 09:05:40 -0700 (PDT) Date: Mon, 6 Jul 2020 17:05:39 +0100 From: Jamie Iles To: Ard Biesheuvel Cc: linux-crypto@vger.kernel.org, Corentin Labbe , Herbert Xu , "David S. Miller" , Maxime Ripard , Chen-Yu Tsai , Tom Lendacky , Ayush Sawal , Vinay Kumar Yadav , Rohit Maheshwari , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Jamie Iles , Eric Biggers , Tero Kristo , Matthias Brugger Subject: Re: [PATCH v3 10/13] crypto: picoxcell - permit asynchronous skcipher as fallback Message-ID: <20200706160539.GE84554@willow> References: <20200630121907.24274-1-ardb@kernel.org> <20200630121907.24274-11-ardb@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200630121907.24274-11-ardb@kernel.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Jun 30, 2020 at 02:19:04PM +0200, Ard Biesheuvel wrote: > Even though the picoxcell driver implements asynchronous versions of > ecb(aes) and cbc(aes), the fallbacks it allocates are required to be > synchronous. Given that SIMD based software implementations are usually > asynchronous as well, even though they rarely complete asynchronously > (this typically only happens in cases where the request was made from > softirq context, while SIMD was already in use in the task context that > it interrupted), these implementations are disregarded, and either the > generic C version or another table based version implemented in assembler > is selected instead. > > Since falling back to synchronous AES is not only a performance issue, but > potentially a security issue as well (due to the fact that table based AES > is not time invariant), let's fix this, by allocating an ordinary skcipher > as the fallback, and invoke it with the completion routine that was given > to the outer request. > > Signed-off-by: Ard Biesheuvel Thanks Ard! Reviewed-by: Jamie Iles