Received: by 10.223.185.116 with SMTP id b49csp2344914wrg; Thu, 15 Feb 2018 10:08:44 -0800 (PST) X-Google-Smtp-Source: AH8x224QzvqviHwSdI3cDnuYxeOvQglTFQKTjWCaFuUdSr9hODs9hfpCEgD8JxVoB/FvzyKPdnaO X-Received: by 2002:a17:902:4003:: with SMTP id b3-v6mr3295619pld.154.1518718124028; Thu, 15 Feb 2018 10:08:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518718123; cv=none; d=google.com; s=arc-20160816; b=jujTj5tl0jBa5K0slTtXl/G3sUvSNAQm2+X+/VpQCM6tplibO8TJnnx/+jsNXj83to QTw9mzAwuc4m6c/WaZqzDKizD5hV7cf95gcG48VJZNllxKE3s/SXsihFdd3FftlcXBoE HW9kD7m6sRnT+/rXyhoUkmuizYoV7otfpmDcLbFvTW2qnqJbV0qwMxMM+CCzNVZrZX9i 5t+3wrk0FOImklL3pFwWyMPYF1wvL4vgKGWjrqP+QZoED7vDOq/CV2ss8H2hQlxeF76p cGS6LP8JdbILssly7rRcXhTyAqXk09pLx3B2p1GJlctDH3CKdOC7zv6+W7OGZa4qenDn QRow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:cc:to:subject:dkim-signature :dkim-filter:arc-authentication-results; bh=VBz4tY6vtCdF/3/SiFSxpCmtUWNul3rCnWaIYedG3gk=; b=xmMzJZWUSiSHQeJl2w1+84Er3A2Z5l1en4w4P6KvSkCbfexTm+q7uATbwUfNojocqo 69BCPX5OQEZhqu+jZ+Ne6Z1FjBVfm2ZNV6dJ5TNvuJEHbpdTLhwsbN18H5Nmn3EfAQnO H/lTG3/ch76kPqXkSA9QcpYtaqG5BMU4p5uNf1ry2tMimYnLQFAlc+XWX4qSmO0Lvu20 3o3WWbYkPQRj9kRJ9DNYzCNROmAqU/gpjp2lYTI3LXFMPjgT1u0Ye4SnCRxD/Y/6bO35 KnZOgLvZYxr9uhuSc90sqkUsrBWniofKd5FTnWmJokaXR1M1UVwd24vvLEkpICf+KZqt xxEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=HxtH8RNp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a11si6596244pgd.549.2018.02.15.10.08.28; Thu, 15 Feb 2018 10:08:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@samsung.com header.s=mail20170921 header.b=HxtH8RNp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1164129AbeBOSHD (ORCPT + 99 others); Thu, 15 Feb 2018 13:07:03 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:38445 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163521AbeBOSHA (ORCPT ); Thu, 15 Feb 2018 13:07:00 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180215180657euoutp0229085d9d33700a5309a1f8786a2bcaed~Tkf2Z7TOI2322623226euoutp02X; Thu, 15 Feb 2018 18:06:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180215180657euoutp0229085d9d33700a5309a1f8786a2bcaed~Tkf2Z7TOI2322623226euoutp02X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1518718017; bh=VBz4tY6vtCdF/3/SiFSxpCmtUWNul3rCnWaIYedG3gk=; h=Subject:To:Cc:From:Date:In-reply-to:References:From; b=HxtH8RNp86Hid5uv7ihbbWcMFv+8lwTODb1LTIoQi5aKVH4xOVAWcpar42+CTkFRs aCpSVBvVK1SEQdTJ3OIFp6AsGolE5Qw60zfnHChV4dedLyaDEtj9fmnHgJzZhVI8NO cYB2fpt9jYKHOXMDj4PGj68zymZYSdIta911oXb8= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180215180656eucas1p1a2033e19a21550cc160dc3ef6700242c~Tkf1WOUL31450114501eucas1p1S; Thu, 15 Feb 2018 18:06:56 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 00.2F.10409.04CC58A5; Thu, 15 Feb 2018 18:06:56 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180215180655eucas1p16a614dbbebc375fcfd148d5a8ecaf02b~Tkf0G3C051160911609eucas1p1P; Thu, 15 Feb 2018 18:06:55 +0000 (GMT) X-AuditID: cbfec7f5-b45ff700000028a9-01-5a85cc40a3a4 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 26.3E.04178.F3CC58A5; Thu, 15 Feb 2018 18:06:55 +0000 (GMT) Received: from [106.120.51.18] by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P47005MYEBI7K00@eusync1.samsung.com>; Thu, 15 Feb 2018 18:06:55 +0000 (GMT) Subject: Re: [PATCH v3 0/5] crypto: ahash.c: Require export/import in ahash To: Marek Vasut , Herbert Xu Cc: linux-crypto@vger.kernel.org, "David S. Miller" , Bartlomiej Zolnierkiewicz , Sonic Zhang , Fabio Estevam , Shawn Guo , Tom Lendacky , Jan Engelhardt , Arvind Yadav , Linus Walleij , Joakim Bech , linux-kernel@vger.kernel.org From: Kamil Konieczny Message-id: Date: Thu, 15 Feb 2018 19:06:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-version: 1.0 In-reply-to: Content-type: text/plain; charset="utf-8" Content-language: en-US Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA01Se0hTcRTud19ercmvqeyUYrQQepAWWV4wyh7EjYgKEmqVecuLSr7asrIX Zlo6NWsZ2SozEpf2nNoyc6ZTWpEyUhKs+chhmbUgLOlhVvNO2H/fOef7zjnf4bCkvJOeySam HBDVKUKSkvGhTM9+2hZGteWoFhW8YbiuwhskZyy5T3NXbdkUp9cu5PKHg7isj06CG6kapLji MQPB9fX+JLjO+qsM9/n0ScQN3isnOfvDUwzXWtxIR/nyOR1/GH749Sq+trKb4Ev1zyl+vKWI 4B/re7x4U1MIb3z/geLtXQ0Mf7a2CvEj1cGbp6p8lseJSYkHRXXYilifhJJrb5k0s+KwubKb yUQmuRZ5s4DDwVrVQmmRDyvHtxA86SsjpGAEwZXCZjTJyhpykFKhAoGz3+CWvEdwzVnvpUUs 64c3wK8x7BL44/Xw7mku7eKQeIAEXfPdiU4MjoCBR22EC8vwOmgaPTOBKRwC/T01pAsH4G1w 4+IgkjjT4ceFXsrV3xtHgta+zJUm8TwY+qajJKyAUzndbjwLau44JxYFXOEFhv5yRnKwFhrP F7jd+MGwtdZLwkGQl9tMSIIiBEWll2kpKEHgMLbTEisSWqyvaGmEL+hMl0jXRoBlkHvafUge frc63QNWgck8TEsXGiSgts1Gn0PBeg9Deg8Xeg8Xeg8XZYiqQgoxXZMcL2qWpIiHQjVCsiY9 JT50b2pyNfr/ai/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q6rk7KVLiyNvO H2F3r3V/+RT1NzNxW6TbTudbSz28PvlckFK0lGNij2P5plrwWj3v0ozHSizFGYmGWsxFxYkA ow414rQCAAA= X-CMS-MailID: 20180215180655eucas1p16a614dbbebc375fcfd148d5a8ecaf02b X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180118183438eucas1p2e2e7be8625ae0950c519e27424f9301a X-RootMTR: 20180118183438eucas1p2e2e7be8625ae0950c519e27424f9301a References: <20180118183404.12583-1-k.konieczny@partner.samsung.com> <20180215154132.GA7352@gondor.apana.org.au> <6b29116a-c39c-9813-34a0-d5c05bd30c9d@denx.de> <32069edc-e816-6ab0-f057-b1dab5d30db4@partner.samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15.02.2018 18:06, Marek Vasut wrote: > On 02/15/2018 06:00 PM, Kamil Konieczny wrote: >> >> >> On 15.02.2018 17:27, Marek Vasut wrote: >>> On 02/15/2018 04:41 PM, Herbert Xu wrote: >>>> On Thu, Jan 18, 2018 at 07:33:59PM +0100, Kamil Konieczny wrote: >>>>> First four patches add empty hash export and import functions to each driver, >>>>> with the same behaviour as in crypto framework. The last one drops them from >>>>> crypto framework. Last one for ahash.c depends on all previous. >>>>> >>>>> Changes in v3: >>>>> added change for bfin_crc.c >>>>> make this a patchset, instead of unreleated patches >>>>> make commit message more descriptive >>>>> >>>>> Kamil Konieczny (5): >>>>> crypto: mxs-dcp: Add empty hash export and import >>>>> crypto: n2_core: Add empty hash export and import >>>>> crypto: ux500/hash: Add empty export and import >>>>> crypto: bfin_crc: Add empty hash export and import >>>>> crypto: ahash.c: Require export/import in ahash >>>>> >>>>> crypto/ahash.c | 18 ++---------------- >>>>> drivers/crypto/bfin_crc.c | 12 ++++++++++++ >>>>> drivers/crypto/mxs-dcp.c | 14 ++++++++++++++ >>>>> drivers/crypto/n2_core.c | 12 ++++++++++++ >>>>> drivers/crypto/ux500/hash/hash_core.c | 18 ++++++++++++++++++ >>>>> 5 files changed, 58 insertions(+), 16 deletions(-) >>>> >>>> All applied. Thanks. >>> >>> This makes no sense, cfr my comment on 5/5 >>> >>> Seems like if the driver doesn't implement those, the core can easily >>> detect that and perform the necessary action. Moving the checks out of >>> core seems like the wrong thing to do, rather you should enhance the >>> checks in core if they're insufficient in my opinion. >> >> The bug can only be in driver which will not implement those two functions, >> but we already had all drivers with those due to patches 1..4 >> All other drivers do have them. > > The core can very well check if these functions are not populated and > return ENOSYS > >> Additionally, with crypto we want minimize code and run as fast as possible. > > So you remove all NULL pointer checks ? Esp. in security-sensitive code? > What is the impact of this non-critical path code on performance? > > Come on ... > Why you want checks for something that not exist ? Those without them will not work and will do Oops in crypto testmgr, so such drivers should not be used nor accepted in drivers/crypto Ask yourself why crypto do not check for NULL in ahash digest or other required ahash functions. >> Moving checks out of core will impose on driver author need for implement >> those functions, or declare them empty, but in case of empty ones >> crypto will not work properly with such driver. > > You can very well impose that in the core, except you don't duplicate > the code. Now size of crypto core is reduced. -- Best regards, Kamil Konieczny Samsung R&D Institute Poland