Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3905978ybi; Mon, 27 May 2019 07:51:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmZox0fg+ZBMEtvnnxReDiHlYCZ5h7TwsIQawgR8Z/hOd2SVjBzvCDL73peHv3oEZPchBM X-Received: by 2002:a17:90a:37ef:: with SMTP id v102mr32106252pjb.12.1558968709515; Mon, 27 May 2019 07:51:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558968709; cv=none; d=google.com; s=arc-20160816; b=EGfbj4I9qHK0/B3QwenBpaGZI77MuPo02kySwp9gFZg+TrPpv1peE8x/LNHwalcU6n 7VXRtMQJd1Ge1V2bR/knx4hOS5JT5FwtcFmGLAV7qV46R0VpAXMfqvTi055swL3hjzUN EcCmP6oBSuLeTZ5fo0JR5k0FJ4licdlQPbU238zu+FZTJfwzniPUtm6tsi9djiXAeqP8 IGlyEtsLiMw/21lUHHS4Smaa8s02fieVRpejnjLobQTOTUxoYoOc1iusM5Banw9krJtZ eNDIF5W0ZJmKAF20s8AttFu+qcwwnpJUdThzE1g68BsV1ppbl+WytMWYRX2egXV3Avjt vrPQ== 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=4hbCSQCK4ocM7KeKUEQJnR/igGMxr2D4lwXxSdDADMw=; b=cjrHFIIPEyhpBHclFW0qQLmn0nLXiNdrEsEbtGx3YbN1Gf4zHlzjPZDotxOOjBPE+i YayzXLIahfO7TcgPVEYZAYDcDTFgwqAzJaELHIqSW9zw1TD2cieNNHAx4oz33oXx5+s9 yqQ8DSZXzwV965kIodWZ1OTZJf+kdtlF/zXbixi5qiNjot/vSykxuTqdj/3jdO2RNmhs tAuu0ygHU6bCAbCvbLH57pbe34GTv0ZhBsVnpWCkdPiE0RMHHgxtSojtZCzRoxao+vpP untioefw9Zk1jReocrtbdbL5kzumS8aTTuiqiR1nXDjTc8F1XVkmg//m/RZ5DkiHfDp/ pozg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CfG4ait1; 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 z4si19338672pgh.334.2019.05.27.07.51.27; Mon, 27 May 2019 07:51:49 -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=CfG4ait1; 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 S1726165AbfE0OpW (ORCPT + 99 others); Mon, 27 May 2019 10:45:22 -0400 Received: from mail-it1-f175.google.com ([209.85.166.175]:54454 "EHLO mail-it1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726094AbfE0OpW (ORCPT ); Mon, 27 May 2019 10:45:22 -0400 Received: by mail-it1-f175.google.com with SMTP id h20so27201755itk.4 for ; Mon, 27 May 2019 07:45:22 -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=4hbCSQCK4ocM7KeKUEQJnR/igGMxr2D4lwXxSdDADMw=; b=CfG4ait18ZloKqxdvQkVEkSLLxbX/JX5ppAPdAlMfYgYtKssYljr0y2f0njNQKU8/I pUcb/ewTZcHZdBTsLoaIHvidWV4ZF6vHyJYDn/1yDyFiH1esATg2paroDERJxuxQCW0a u4C4oRFUsFr4xpeLgRM619CU902dpURycS1Lwrrmun1pE2j+LfJ0TiVEwizbtyYsDwaS Wgtp/3syyRGw3UOzwSANltzzsz5e89k/szjXL8k/f0SzbKkUyW8Z73gJWQJEdBVEjc+O doCPdhor1fJbhtUCXQTRlxTAL8E4bC46fDCm2yVS3LMgEx7LgVYO2ei0e8zNRCOEQq22 msCw== 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=4hbCSQCK4ocM7KeKUEQJnR/igGMxr2D4lwXxSdDADMw=; b=Uc9tnZckQiJQh8jHiBdWA+XO/HGhi73GPYG98EprEgACErlN0gOco99jPJvKBmDPvS eNY/AjXeJXd2BqNKCURwAkhYlaSZB/nOg7aWvonKXqQX0BdNJWjmwJcVGFtWqhE2rURg c46qHoBCTGcgUfWXvNa0dR/4L7zPnDQlemPdAI0H4LPm9YaIISMKNWD8lwCIltMSSMbI 0RjpuELcX5zWPPWBKIfiJDs330E1L8J21EtBhyD4UkzCA7I+nieEHK+lMlDnZzQWI++8 GyIsRKGiad6mFsVTBMBRSafL44FKKGqFVPRxa3ZBwHym5SNj8QMKuCg9HZG1907cGT1+ 8UWQ== X-Gm-Message-State: APjAAAXWFhH+meTNkItUJUJXLogHlyoO7t3f4F+1964igcWHMM4ZFTgq SW9WG7iQjbAj1osO8qvUIz2nngWoMF2/T+UUbdExyg== X-Received: by 2002:a24:ca84:: with SMTP id k126mr27079188itg.104.1558968321851; Mon, 27 May 2019 07:45:21 -0700 (PDT) MIME-Version: 1.0 References: <20190523185833.GA243994@google.com> <20190523200557.GA248378@gmail.com> <20190523234853.GC248378@gmail.com> <907eb6a5-dc76-d5ee-eccf-e7bd426a0868@c-s.fr> In-Reply-To: From: Ard Biesheuvel Date: Mon, 27 May 2019 16:45:10 +0200 Message-ID: Subject: Re: another testmgr question To: Pascal Van Leeuwen Cc: Christophe Leroy , "linux-crypto@vger.kernel.org" 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 Mon, 27 May 2019 at 14:41, Pascal Van Leeuwen wrote: > > > And if you go that naive route, just fix everything in the driver, then > > you simply end up with something terribly inefficient because all those > > corner case checks end up in the fast path and eating up code space. > > > One thing I forgot to mention here that should especially interest you: > you add a lot of complexity to the *driver* that needs to verified and > maintained (by the kernel community?!). Some of these workarounds I had to > implement are really quite a convoluted mess and it's starting to take up > a significant portion of the driver's code base as well ... just to support > some fringe cases that are not even relevant to the hardware's main use > cases (as "we" as the "hardware vendor" see it) at all. > > Note that I actually *have* implemented all these workarounds and my > driver is fully passing all fuzzing tests etc. I'm just not happy with it. > Good, glad to hear that. I would test it myself if my MacchiatoBin hadn't self combusted recently (for the second time!) but there are some others that volunteered IIUC? I think nobody is happy that we are adding code like that to the kernel, but it seems we will have to agree to disagree on the alternatives, since teaching the upper layers about zero length inputs being special cases is simply not acceptable (and it would result in those workarounds to be added to generic code where it would be affecting everyone instead of only the users of your IP) But I fully understand that dealing with this case in hardware is not feasible either, and so this approach is what we will have to live with.