Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp833141ybg; Sat, 26 Oct 2019 08:07:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqxXY/kM4GvdLsOpNz0npcid5eN6KlnmNSsg7xvvZYoWiuOpv7Er8P6vXsQp21fx4MC6QjGu X-Received: by 2002:a17:906:a986:: with SMTP id jr6mr8595336ejb.158.1572102447117; Sat, 26 Oct 2019 08:07:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572102447; cv=none; d=google.com; s=arc-20160816; b=LQV7A86QZhuSwWBVUGhrvjySGpqhiRTZHki6YPDR03BJWkdjHSrxOu9z/lgngxrKCE dAxk+OT6fxj+uxyw6/AZZNVbajlV/wKEmkkLAy0KS2R6OGbjTSw8YqmU782EyuRMvxEW DY98bRh/qnwz2dmYJQHj9P40PcAnNOJS0WX1meamFFXNFIg0bF55AE+7EnPye8jxz5Fs d/je0bwjabF6IX4mp7YoWHGtdXRm4pq9yp5G7dUnXYBf3XkckDlSTEchjTvutQ0/xbgj 3uZtvSezYgThjtCzR4K08+d0FYvSWRg/iBFcXfba75Xbud7xcGGzvsf5ngpq0C+7yc32 YZKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=QLAGBMMJrZggygVygRsryefuvxd8XaBmeOF2j1/ecNE=; b=emGzdSSAjbNfvlMLcqaK5PLL6dbpRrzGCLnnnxAqXJKniGrZ27zMI6jQ06qbJe8+Pm /e5Kqrudxl2BNpZwPeOiIuJvzq2EKFYClfcIqDHWGOFDrNnRvn2Aq4v4/kp3EymIHgod nHcbpM4abfVj/8SiwxAbqp79hrnG897astsREWY8LP9bIkk+xWtZjcBECFYED5iz2dfZ JC5qwxIUoC01e/epNy/Ufvxm8AOiNsP7lzi5EjNpnap2QnMJ9e4cj0kcgkD8GuNH6Pu6 r/KDJEVvWc/epp9YE4weg5tpYpxOw33+NgtKiImUZlDLuPHRl3lCWStPXkT11/hx7+dm 6ZGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rVmRABxh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12si3093857ejd.17.2019.10.26.08.07.02; Sat, 26 Oct 2019 08:07: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; dkim=pass header.i=@linaro.org header.s=google header.b=rVmRABxh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726202AbfJZPG3 (ORCPT + 99 others); Sat, 26 Oct 2019 11:06:29 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:45630 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbfJZPG3 (ORCPT ); Sat, 26 Oct 2019 11:06:29 -0400 Received: by mail-wr1-f66.google.com with SMTP id q13so5421610wrs.12 for ; Sat, 26 Oct 2019 08:06:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QLAGBMMJrZggygVygRsryefuvxd8XaBmeOF2j1/ecNE=; b=rVmRABxhe02YgSdyMdnuJuo7BC1VPq00UtE12fKace9MDodEtRUmLGayaFndOTO/Xc LxQVjfNk1DO8VugPd8m2OvFXlRs7rdts936KkHd4Zy7EX7qPmd66ifrqRZQ7gIG5PyR+ kEY/RCCfuvyboqO51pyaBgbBJE90y2auSV+EMoNq8cKeZOApIl/DZwFrqikw0d8oQ+r5 m6QLFsiQYH/8TAwTprrT8+JYzG992Uw3N47xL+IEV4PH0Eexe464o36bxn1yJzo1Cqz6 La5BmtFmD//TuanHacSeWuFfcShr4bPsIzDf3A08t+Me4ZG84OJZkDR0aMuKTbBSeTxe OcIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QLAGBMMJrZggygVygRsryefuvxd8XaBmeOF2j1/ecNE=; b=Gj8zuwsfG23/u++tkck/LuaJSQebPnD8RcGZOmnHREOfk29guOUf23stzhO+vChOJc uFij6tSeZlCxavr3ztUURkgzy1jELWcCibEjdPL3XcB8kbm8hPieC3Ve36tB2dCMZkFg /stVh5PhlrcUXmorkSrSDibYX7+ITFH7AdllpYLQDOnXPh8MaiERs5Oq1Lg+EJYcXxTm YpUlKdpbO06vnrZPztZPHvIwSL2uloiiuyVGavmpjffj7bRmwpZyI4SsuxSwd1faeN1Z nig/tSeBO9iV8eyabi4xrmO3fcv+xZ+gfxDo89se6Kf3p2+4jLfXhhPF9SHbeyime10T n75A== X-Gm-Message-State: APjAAAVxnv7QTT/otxCKpn977+TLMUqLbcj4F3ftgwpa8q8tN0p0U9AO CNGPWy+au4kzCNaK2JcsQvHNVl3Dha+Y3g2bWxqpBsbg5mk= X-Received: by 2002:adf:fd88:: with SMTP id d8mr1736438wrr.200.1572102386529; Sat, 26 Oct 2019 08:06:26 -0700 (PDT) MIME-Version: 1.0 References: <20191017122549.4634-1-t-kristo@ti.com> <8f97d690-a88a-55cb-eb67-206e01873d94@ti.com> <359434e9-3289-2982-edc1-b93e76c28700@ti.com> In-Reply-To: <359434e9-3289-2982-edc1-b93e76c28700@ti.com> From: Ard Biesheuvel Date: Sat, 26 Oct 2019 17:06:25 +0200 Message-ID: Subject: Re: [PATCH 00/10] crypto: omap fixes towards 5.5 To: Tero Kristo Cc: Herbert Xu , "David S. Miller" , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , linux-omap@vger.kernel.org, linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, 25 Oct 2019 at 14:18, Tero Kristo wrote: > > On 25/10/2019 15:05, Ard Biesheuvel wrote: > > On Fri, 25 Oct 2019 at 13:56, Tero Kristo wrote: > >> > >> On 25/10/2019 14:55, Tero Kristo wrote: > >>> On 25/10/2019 14:33, Ard Biesheuvel wrote: > >>>> On Thu, 17 Oct 2019 at 14:26, Tero Kristo wrote: > >>>>> > >>>>> Hi, > >>>>> > >>>>> This series fixes a number of bugs with omap crypto implementation. > >>>>> These have become evident with the changes to the cryptomanager, where > >>>>> it adds some new test cases and modifies some existing, namely the split > >>>>> update tests. Also, while fixing the cryptomanager induced bugs, some > >>>>> other surfaced with tcrypt/IPSec tests, so fixed them aswell. > >>>>> > >>>>> Patch #9 is against crypto core modifying the crypto_wait_req > >>>>> common API to have a timeout for it also, currently it waits forever > >>>>> and it is kind of difficult to see what test fails with crypto manager. > >>>>> This is not really needed for anything, but it is kind of nice to have > >>>>> (makes debugging easier.) > >>>>> > >>>>> This series has been tested on top of 5.4-rc2, with following setups, > >>>>> on AM57xx-beagle-x15 board: > >>>>> > >>>>> - crypto manager self tests > >>>>> - tcrypt performance test > >>>>> - ipsec test with strongswan > >>>>> > >>>>> This series depends on the skcipher API switch patch from Ard Biesheuvel > >>>>> [1]. > >>>>> > >>>> > >>>> Hi Tero, > >>>> > >>>> On my BeagleBone White, I am hitting the following issues after > >>>> applying these patches: > >>>> > >>>> [ 7.493903] alg: skcipher: ecb-aes-omap encryption unexpectedly > >>>> succeeded on test vector "random: len=531 klen=32"; > >>>> expected_error=-22, cfg="random: inplace may_sleep use_finup > >>>> src_divs=[44.72%@+4028, 14.70%@alignmask+3, 19.45%@+4070, > >>>> 21.13%@+2728]" > >>>> [ 7.651103] alg: skcipher: cbc-aes-omap encryption unexpectedly > >>>> succeeded on test vector "random: len=1118 klen=32"; > >>>> expected_error=-22, cfg="random: may_sleep use_final > >>>> src_divs=[41.87%@+31, 58.13%@+2510]" > >>>> > >>>> These are simply a result of the ECB and CBC implementations not > >>>> returning -EINVAL when the input is not a multiple of the block size. > >>>> > >>>> [ 7.845527] alg: skcipher: blocksize for ctr-aes-omap (16) doesn't > >>>> match generic impl (1) > >>>> > >>>> This means cra_blocksize is not set to 1 as it should. If your driver > >>>> uses the skcipher walk API, it should set the walksize to > >>>> AES_BLOCK_SIZE to ensure that the input is handled correctly. If you > >>>> don't, then you can disregard that part. > >>>> > >>>> [ 8.306491] alg: aead: gcm-aes-omap setauthsize unexpectedly > >>>> succeeded on test vector "random: alen=3 plen=31 authsize=6 klen=9"; > >>>> expected_error=-22 > >>>> > >>>> Another missing sanity check. GCM only permits certain authsizes. > >>>> > >>>> [ 9.074703] omap_crypto_copy_sgs: Couldn't allocate pages for > >>>> unaligned cases. > >>>> > >>>> This is not a bug, but I'm not sure if the below is related or not. > >>>> > >>>> I'll preserve the binaries, in case you need me to objdump anything. > >>> > >>> What are these tests you are executing? For me, the testmgr self test > >>> suite is passing just fine. Any extra tests you have enabled somehow? > >>> > > > > I enabled CONFIG_CRYPTO_MANAGER_EXTRA_TESTS, which enables a bunch of > > fuzz tests of the offloaded algorithms against the generic > > implementations. > > Ahha I see, let me give that a shot locally. I have so far only been > testing with the standard suite. > > > > >>> I am also running full test on different board though (am57xx), I > >>> haven't been explicitly running anything on am335x. > >> > >> Oh, and btw, did you try without my series? I think the selftests are > >> failing rather miserably without them... > >> > > > > No, I just tried a branch with mine and your patches applied. > > Could you give it a shot without the CRYPTO_MANAGER_EXTRA_TESTS, that > should pass with my series, and fail without? > The missing output IVs are fixed by this series, but it seems we need some more work to get all the wrinkles ironed out. I sent some patches on top that address a couple of them, but we still need a proper fix for the situation where only assocdata is presented, and cryptlen == 0 Feel free to merge my patches into your series, or take bits and pieces into your own patches where needed.