Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp204490ybl; Tue, 28 Jan 2020 01:31:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxcrS7S+0zwiQClceva0+mOBRenA9GyiuVS7HnC6RR2f6PtBKCJJBZScr91kiKWVCD6pHx/ X-Received: by 2002:aca:2416:: with SMTP id n22mr2083051oic.169.1580203890890; Tue, 28 Jan 2020 01:31:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580203890; cv=none; d=google.com; s=arc-20160816; b=xvhl7iP+T5WyY8mEBOdEu0aLKQMBGjbByvcIUd5OEdttrcMIkNrQjFUUrBY+O74B88 2S54QqPdzwe6tcphfgnl86o5m/dDQZrgYIgR8v47X/ApG+OH9A++7FcACMKgPlWN0S3o qDBIfOnD0tVoIhKlxIfP88Bj15L/Nh0oUBLUbUEl7pnJrY4dnmdq5HO0eI9U47BGwUOo 6LNT/aCnf2P4LSRF+h2IpMqMFX65yiS6tl7ffVHc/LqddypbxKP4dWlh9NaByBTC8KAm MOUqEZ2A6rFcqNtlI0aWoYeZle/MFqnWdyrigyU9sn8UR4qIykP665WGHtnn4PizIKHa 1iDw== 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=drtFf4BYqD16KtABSK9GXNjl2syyckGlTVrDm3GnTCM=; b=nXCRdkjMpQnwSxWNo7ccTS/ZzFCaJcT8un1BRPR09Se8+sw1wMMgIHpwCjCxp+3+7H 4RQR0w9qYvIcjCxSckuJlAETmFghZSP76CdhDTKcH7UsGQl/Y6ZD1LBxv+gE5lV4VjAc 6M5CrMsWm+cjiq8fQXlJ8MLKGhlnORjyghLnNr0pIdK2+8qr5OB1QqtukhtsS7ZEOxdQ E8q/RnHWeaG6l/Cyv03oW5R3WfWusmommvhvHfJ8cclGVCyTiNWlwbHDKPfSKYfUngND LuvoNOT6FiuB+pQhpZLJUmncciwivzyka9z/gsqGxydf2h+7VvYjn7mFVkJoTo5TYnjv jXiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@benyossef-com.20150623.gappssmtp.com header.s=20150623 header.b=sKfibvDG; 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 p11si8577418ota.300.2020.01.28.01.31.09; Tue, 28 Jan 2020 01:31:30 -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=sKfibvDG; 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 S1725882AbgA1JbI (ORCPT + 99 others); Tue, 28 Jan 2020 04:31:08 -0500 Received: from mail-vs1-f66.google.com ([209.85.217.66]:46653 "EHLO mail-vs1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725271AbgA1JbI (ORCPT ); Tue, 28 Jan 2020 04:31:08 -0500 Received: by mail-vs1-f66.google.com with SMTP id t12so7605013vso.13 for ; Tue, 28 Jan 2020 01:31:07 -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=drtFf4BYqD16KtABSK9GXNjl2syyckGlTVrDm3GnTCM=; b=sKfibvDGOGsQEi8+DU56KeTpeAqC6oMr2xZa51isMZyqL3h5FmoUB4gAOKzWFxBhz3 KOdDZBEJ8xNxwGwPU+oOyS7zsccP5/K/gsw/oPig30OKQkDizpEBFwGx/f2oSBwD5Q0m 0Irwc7cDuUtmQf1byT/PmmPMH5UrVXt0BaFsUDCdEFUiulf/b94FyJb4yE5MV36g9cfh 6UtVr3UbZI5HgqkKC0mA1UTZA2DTNpKdsbVqsAHnLoQlkYFdF1FQeKJBEzhaeUJgsUhd Y72Sto6VKJ9dLhyj1LPsxny83/6I1VNgsFzZzT2ZyZVyVBHxfAcnoN5j5DT6cDjLfCGu UW6g== 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=drtFf4BYqD16KtABSK9GXNjl2syyckGlTVrDm3GnTCM=; b=fJMFzXgRq/cicFrvteS2iopLUNsGIp7D8XN69fj43loOXzF3StNU6H2jftxu7ZdJGU kaOBAqfVYMyD3XpJG83qQOrI97No4IBJs/X+MIA9BmwErVkozZNK80fab7FfqCK89fMu Fj4ixcLexhTJUDchq3xo+x0JTr05eabI50dAjXIWQdsZLnnJb9r2aBxzdpc1oV7mCqzx 701G5iIYXZ2NsGTyA8Plw8885YGbi4VSODBRr6wYa+aW1Simeyo7tRmvIX3FA8mXtcbS d1DsY1cwg/OWmZlBxggmNxFO+7scjDPlBGQxwy7mOj6nofKSN9J8ex7zfNsDgfsPnnlV //kw== X-Gm-Message-State: APjAAAU1VOaJItEFkODmvCSIDCG7aDeQF3bxZo5+7g+COZb7fDMaSJcd EE4/WsGHi5yptyiFEQECp4AX0XvSVTsW7jaERJ1o7g== X-Received: by 2002:a67:c90d:: with SMTP id w13mr12308705vsk.164.1580203867395; Tue, 28 Jan 2020 01:31:07 -0800 (PST) MIME-Version: 1.0 References: <20200127150822.12126-1-gilad@benyossef.com> <20200128030107.GF960@sol.localdomain> In-Reply-To: From: Gilad Ben-Yossef Date: Tue, 28 Jan 2020 11:30:54 +0200 Message-ID: Subject: Re: [RFC v3] crypto: ccree - protect against short scatterlists To: Geert Uytterhoeven Cc: Eric Biggers , Herbert Xu , "David S. Miller" , Ofir Drang , Linux Crypto Mailing List , Linux Kernel Mailing List 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 Tue, Jan 28, 2020 at 10:30 AM Geert Uytterhoeven wrote: > > Hi Eric, > > On Tue, Jan 28, 2020 at 4:01 AM Eric Biggers wrote: > > On Mon, Jan 27, 2020 at 04:22:53PM +0100, Geert Uytterhoeven wrote: > > > On Mon, Jan 27, 2020 at 4:08 PM Gilad Ben-Yossef wrote: > > > > Deal gracefully with the event of being handed a scatterlist > > > > which is shorter than expected. > > > > > > > > This mitigates a crash in some cases due to > > > > attempt to map empty (but not NULL) scatterlists with none > > > > zero lengths. > > > > > > > > Signed-off-by: Gilad Ben-Yossef > > > > Reported-by: Geert Uytterhoeven > > > > > > Thank you, boots fine on Salvator-XS with R-Car H3ES2.0, and > > > CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y. > > > > > > Tested-by: Geert Uytterhoeven > > > > Note that you need to *unset* CONFIG_CRYPTO_MANAGER_DISABLE_TESTS to enable the > > self-tests. > > Sorry, that's what I meant (too used to type "=y" to enable something ;-) > > > So to run the full tests, the following is needed: > > > > # CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set > > With just this, it no longer crashes. > > > CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y > > With the extra tests enabled, it still crashes :-( > That's fine - this is the second issue I was talking about. The patch I sent before was not really a fix - more a stop gap designed to see if I understand the issue you are seeing. I will send out a patch fixing the root cause of both and this should resolve both issues. I just want to run it through some internal tests to make sure it did not break something else first. Thanks! Gilad