Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp930507ybl; Thu, 23 Jan 2020 10:19:24 -0800 (PST) X-Google-Smtp-Source: APXvYqyk6zZsH1nIjbYLd6RvQqm0jqikrvstCdNfCc5BXaUdj37UXK1crc8Qas87+9G7rV/wG3kg X-Received: by 2002:a9d:7f11:: with SMTP id j17mr12746918otq.281.1579803564237; Thu, 23 Jan 2020 10:19:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579803564; cv=none; d=google.com; s=arc-20160816; b=hFfl2Qj0lXxdi67SB2mvn+6U1B5dwrIvaq0ZVD8IRKWXDXXpo8k622HoM3SCM8wNep 3SUeUvPywAyFE+qPbYsda8W0CzcpupOrhWX5w0w77Bc8DPPcFpAi8xiSApFyHWpDGuYr oCNsYpbkK/NvYFSefm8arEGMUCgVcaHQ9bmmpvhujMlpgZrTKy65RjzD+BbhYY1IDtcF akEee0xSGrKREJMx02Al6W5rpn+ul0x/ZJDhzLMOyKeXgF9+d+u3huSLmjDVXqTdqj5Z sWX9H9J0+4vcPacxHEAYG+W4adBsL2pPY9D16Gp6r/T7Znpg/ujrhzIzRaHg6tfIoa71 eHRg== 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=OqxshwjEZk15r2HIYLwJvhZobDP5rWlqMcRJh/RNTO4=; b=TEaPRjpHVf5YT5tkIA4lna2wWj/1pn9LG663SJeXXoOaHkaolc6t+XoEaCCrKw8n7E I1ARjHAu4vyHX1rUfKEZVxQvTg6gNDok0TVJvqx/KxUKwxqoAHrn/caSJzqE7hmFEwBC uhB3fF4y8/w6dVU0k+bhpqJ4H5bZn4PUmACyjad+mL9+Ku6Q4EQF0Sq6IdZYNeYy54rV OnFbUL6rXeHZZ2kIpENlr0bg8ptUflwyIQc6TyesaqcGDTQKShT7Jx+3p95NIdqdnVEc 38ehbgLPAbw6fTajcC8Rmk+HTF6h6kSA+oTcMl+Z4UMVviD49yBfuCuBiwzAFBZbl7UF tCkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@benyossef-com.20150623.gappssmtp.com header.s=20150623 header.b=vWDImQhW; 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 l189si1137904oih.166.2020.01.23.10.19.05; Thu, 23 Jan 2020 10:19:24 -0800 (PST) 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=@benyossef-com.20150623.gappssmtp.com header.s=20150623 header.b=vWDImQhW; 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 S1728998AbgAWSTB (ORCPT + 99 others); Thu, 23 Jan 2020 13:19:01 -0500 Received: from mail-vs1-f66.google.com ([209.85.217.66]:34512 "EHLO mail-vs1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727278AbgAWSTB (ORCPT ); Thu, 23 Jan 2020 13:19:01 -0500 Received: by mail-vs1-f66.google.com with SMTP id g15so2402700vsf.1 for ; Thu, 23 Jan 2020 10:19:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=benyossef-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OqxshwjEZk15r2HIYLwJvhZobDP5rWlqMcRJh/RNTO4=; b=vWDImQhWepEclk+VMgrMtqjicDFT3eIkDyKl3fKOvmTY2bj7EAZYV9HgzGnmXfPlyg 33UX4671AAMqIUqxSIklCyvbUM30AmviPYm12FXMYgej0FKwPweLv45xc1BfDMdgiG34 fhTZSJ4nNbHmRXGc7WLTKF/9kEQrTQ228JcsXqf3xjED9wHtbBOkBNVIjPUh0CLVCbxA +hVOaTvN+d82xDY2LuN0revzmFywaEhJr+Gg+/0cbl12fITXYJlswyhvQHOnjjlLHJ3g ok4rOPVTbE3Bkb2/+WzzTZpApczhCIYVhA9PBBcbPt+fpuWgJXt0WDoSljKei5NBivKF q5Pg== 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=OqxshwjEZk15r2HIYLwJvhZobDP5rWlqMcRJh/RNTO4=; b=qrkE6QayFaid0xUCZYfRgR9uOWduDUdBcCeDNOgOfmMnzLIkgaQQr9R3JkrcTGqYoi PkdvOJlr08e91+pq4zejYpdNT8PwCiNzclPfxlbQEC3vfbbw7AtW0Dwkx7kGxT4aD4xR ReWWigjy1I8wyhcd8PXN2YqnZzIK3SQCZvqpfdqAx9rfW4UQ0gymyn8hyj4bdfJLuo0I hvNbBd+vof24C6NATLifOxoeYEweiHU5FmglutprqPLIQvJ5WOWpKUcrYlH2ZnFhYqTG vT/gg1J9o/vaLW86RGnLDrwSoscqFImAweSRBSXG6xmpPeK4eTsmqOJ2jJCJZpIiNOQc EFkA== X-Gm-Message-State: APjAAAUKTmhFolXS1BlGFGuL+mRvuAWgwzy9+LLb4iL2qgNbBjWPq5G9 eg2lLEzz7i0n2sJ6gMlSkB9ZZd7uNHsHXj+qCTgrlvNNNKU= X-Received: by 2002:a67:c90d:: with SMTP id w13mr6769203vsk.164.1579803540508; Thu, 23 Jan 2020 10:19:00 -0800 (PST) MIME-Version: 1.0 References: <20200116101447.20374-1-gilad@benyossef.com> In-Reply-To: From: Gilad Ben-Yossef Date: Thu, 23 Jan 2020 20:18:45 +0200 Message-ID: Subject: Re: [PATCH 00/11] crypto: ccree - fixes and cleanups To: Geert Uytterhoeven Cc: Herbert Xu , "David S. Miller" , Ofir Drang , Hadar Gat , Linux Crypto Mailing List , Linux Kernel Mailing List , Linux-Renesas , Christoph Hellwig 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 Thu, Jan 23, 2020 at 5:46 PM Geert Uytterhoeven wrote: > > Hi Gilad > > On Thu, Jan 23, 2020 at 12:44 PM Gilad Ben-Yossef wrote: > > On Wed, Jan 22, 2020 at 6:51 PM Geert Uytterhoeven wrote: > > > On Thu, Jan 16, 2020 at 11:25 AM Gilad Ben-Yossef wrote: > > > > A bunch of fixes and code cleanups for the ccree driver > > > > > > Thank you! > > > > > > I wanted to give this a try, but it looks like CCREE is no longer working > > > on R-Car H3, both with/without this series. > > > > > > E.g. with renesas-devel[*] and renesas_defconfig + > > > CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=n, I get the following crash: > > > > Thank you for the bug report Geert! > > > > My R-Car board is on loan at the moment to another project. I didn't > > see this on our internal test board. > > I will track down my R-Car board and reproduce this - hopefully > > beginning of next week and will get back to you. > > In the mean time, I've bisected this failure to commit cdfee5623290bc89 > ("driver core: initialize a default DMA mask for platform device"). > However, this looks like a red herring, and seems to be only an exposer > of an underlying problem. Thank you for continue digging into this. > What's happening is that cc_map_aead_request() receives a request with > cryptlen = 0. Due to DRV_CRYPTO_DIRECTION_ENCRYPT, the length to map is > increased by 8. This seems to works fine if there is sufficient space > in the request's scatterlist. However, if the scatterlist has only a > single entry of size zero, cc_map_sg() tries to map a zero-length DMA > buffer, and the BUG)() is triggered. > OK, this does rings a bell - can you verify please if CONFIG_CRYPTO_MANAGER_EXTRA_TESTS is enabled and if it does can you see if it happens if it is turned off? There was an issue I've seen happen only with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS enabled and only after commit 49763fc6b1af4 ("crypto: testmgr - generate inauthentic AEAD test vectors") which I am chasing. I was half starting to believe it was an issue in the testmgr commit and not the ccree driver. However, the stack trace doesn't look exactly the same but the description of the issue does. It seems you are seeing the same issue in another code path. Thank you - this is very helpful! I now have a better direction to look into... Gilad