Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A710C4332F for ; Fri, 14 Oct 2022 19:19:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231236AbiJNTTs (ORCPT ); Fri, 14 Oct 2022 15:19:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231160AbiJNTTr (ORCPT ); Fri, 14 Oct 2022 15:19:47 -0400 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 677E818B20 for ; Fri, 14 Oct 2022 12:19:43 -0700 (PDT) Received: by mail-qk1-x72e.google.com with SMTP id a5so3117735qkl.6 for ; Fri, 14 Oct 2022 12:19:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=AoUaVX7WeSWMFX3nree3fUpxXXfgx6Q4WFZ3tSVkQHg=; b=UiEjKjYPArwu+erj/QUVX0fUkhEFZapV4R65wkaTG4gFBsMcgJkyatk9panVMud2En ULChv0jbZe6RCkW9Iub/eHAKRijGlZZLlyB/QtBtT8Jd2DMUP/dA/wbvumatgVajvxbP G7SxU8S1iwmPUTUEjd4IaN98wy6rQ8LTLC+JOHaboTX6clRtjnZnCfMw6W74UA5pn3tr f4O0lOsL1wNhPGua2PNkidmINtdhwvKbbfBBogrEW1mfetqWW+iVvZDMD0V2+7XBDAhI qJKG3H0SORHdEHhf5ZgcnL9I0h1XitsYBQy83ToiZvytz5BMG8lso5aBrU5+WRL62ScD yTsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=AoUaVX7WeSWMFX3nree3fUpxXXfgx6Q4WFZ3tSVkQHg=; b=M1fyNhwcpUCBtWMxIOlqq4vnHKnh51953dyt424hjxKz+QLVsiM+2r+1+sxlYwVaid Y/8MsO06fR2y2+yKoJJLUw4BhtfI2NUHWZDBo0ONlGEk6ktcYSlG4QfagEmW0VRVvkm3 sjomAyNFcYPqGYhhxR7Yw7TK5mmJ/xLYqnw2IInPAQwyPwqSE85MA1JsTbndtJC5Li/x jCaJ6FutLm9oMDTZxlfE8PgHto1Pvrmk2mQP4hpVWVnLLsBY4euTLAjncL0UGN2Z9Xv5 0/ijY3HYCDIKwRRSO3CLZzDGeYH/AUZEv+FkG9WFBUlKf2a2BR5mY4Bp5MZrQDskcdUa uwaw== X-Gm-Message-State: ACrzQf2mYlwRVTibjAzUlUYoSvfUu6AFOx4bf4t8sTXDbO+4+QzNPY9f OL3AA9OJkrAijtaUAdDuoJ9Icw== X-Google-Smtp-Source: AMsMyM5kq8HSA0NWVB8q1M2PQnkKFbfau0narXlYBV62ON1xN11WXriiPNcPad7RxtFAPMdU5bCjTw== X-Received: by 2002:a37:bd84:0:b0:6cf:6049:f12a with SMTP id n126-20020a37bd84000000b006cf6049f12amr4919050qkf.697.1665775183082; Fri, 14 Oct 2022 12:19:43 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-47-55-122-23.dhcp-dynamic.fibreop.ns.bellaliant.net. [47.55.122.23]) by smtp.gmail.com with ESMTPSA id x78-20020a376351000000b006ce3cffa2c8sm3020159qkb.43.2022.10.14.12.19.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 12:19:42 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1ojQDd-003BJU-IB; Fri, 14 Oct 2022 16:19:41 -0300 Date: Fri, 14 Oct 2022 16:19:41 -0300 From: Jason Gunthorpe To: Herbert Xu Cc: "Jason A. Donenfeld" , Pankaj Gupta , "jarkko@kernel.org" , "a.fatoum@pengutronix.de" , "gilad@benyossef.com" , "jejb@linux.ibm.com" , "zohar@linux.ibm.com" , "dhowells@redhat.com" , "sumit.garg@linaro.org" , "david@sigma-star.at" , "michael@walle.cc" , "john.ernberg@actia.se" , "jmorris@namei.org" , "serge@hallyn.com" , "davem@davemloft.net" , "j.luebbe@pengutronix.de" , "ebiggers@kernel.org" , "richard@nod.at" , "keyrings@vger.kernel.org" , "linux-crypto@vger.kernel.org" , "linux-integrity@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-security-module@vger.kernel.org" , Sahil Malhotra , Kshitiz Varshney , Horia Geanta , Varun Sethi Subject: Re: [EXT] Re: [PATCH v0 3/8] crypto: hbk flags & info added to the tfm Message-ID: References: <20221006130837.17587-1-pankaj.gupta@nxp.com> <20221006130837.17587-4-pankaj.gupta@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: keyrings@vger.kernel.org On Wed, Oct 12, 2022 at 05:06:16PM +0800, Herbert Xu wrote: > > Rather, drivers that do AES should be called "aes". For this hardware > > key situation, I guess that means keys have a type (in-memory vs > > hardware-resident). Then, a crypto operation takes an "algorithm" and a > > "key", and the abstraction then picks the best implementation that's > > compatible with both the "algorithm" and the "key". > > No the key is already in a specific hardware bound to some driver. > The user already knows where the key is and therefore they know > which driver it is. Do they? We have HW that can do HW resident keys as as well, in our case it is plugged into the storage system with fscrypt and all the crypto operations are being done "inline" as the data is DMA'd into/out of the storage. So, no crypto API here. I would say the user knows about the key and its binding in the sense they loaded a key into the storage device and mounted a fscrypt filesystem from that storage device - but the kernel may not know this explicitly. > > If you don't want a proliferation of different ways of doing the same > > thing, maybe the requirement should be that the author of this series > > also converts the existing "paes" kludge to use the new thing he's > > proposing? > > Yes that would definitely be a good idea. We should also talk to the > people who added paes in the first place, i.e., s390. Yes, it would be nice to see a comprehensive understand on how HW resident keys can be modeled in the keyring. Almost every computer now has a TPM that is also quite capable of doing operations with these kinds of keys. Seeing the whole picture, including how we generate and load/save/provision these things seems important. Jason