Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp262787rwe; Wed, 31 Aug 2022 02:18:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR54d7ShFeE0zZxblspxkEtBEW80r/DaXzEKOkJPT7bmgZ79yEL59X4pucmQy1OQOIz6PNnY X-Received: by 2002:a05:6a00:21c2:b0:52b:ff44:666a with SMTP id t2-20020a056a0021c200b0052bff44666amr25600262pfj.83.1661937493546; Wed, 31 Aug 2022 02:18:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661937493; cv=none; d=google.com; s=arc-20160816; b=UyfE51Q2imH/piqn2AmwhxBiGbV96ijViCmU6V0mOL9ATJJQpxMLpEnRtKZ1SMLCnD 8kB0nf3G8UjSiuavAoRjywesA3B7eEdwri3ZuZDrMpFnf7mQa7vgCpqS9SUZAmc2C/Ie OsNwphtmtDNfoSJW/I+ktV4T1Im8lBcAUBL1uY343dmcP4L5V6ehqEnquvk4n+L9ytLX wqpcSYHyl25JVmbuevbA7gKCPIosShZJ9Cr1GkvfuxjxBwF2zzG0Ri3CD2Vic/HIrMsT DAuR/0qbRxwrmL+qxuZ16xlyRRPHeIL8ov7/FHoy65UZj0hnvIPlYJ9m0es+7Nmdp1K7 kWGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=cwXPEUc1yb8fdaLMgPeezt66fL5TEvDVWVjuFiWPPKU=; b=pqLyoNTX4O73dnRg8LoKsYuLE9U1A0/YcNe4IrWGVziU8FZBBg2ZPUEJtnyhv2OKk5 wPWncJEUGJyPXhalLgcpZZlHDMiPbq5GbSI8zve3ScjcaV3udXLGfLtso2GVxKtVzDdK d1Da7Yvngpm6HLP4PpQdLBkATStY1VjMgaRxq2yoUcUQnW+OimhggtDuximh9h9epf3o t8JccGsD2P/OtDE1HS2WENrRWnnhfzIv0LICxaxldj5PX2a/LYlv46YSYqaprU2LUpTY BQIsxniZaGQTb2FzmskrZKaFPzLarzWZS2jjFk2IvnlMia4vQqjvYFE/EgWk4JTTRowG Hslg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jc5-20020a17090325c500b00174acacf74bsi4930574plb.562.2022.08.31.02.17.54; Wed, 31 Aug 2022 02:18:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231721AbiHaI5t (ORCPT + 99 others); Wed, 31 Aug 2022 04:57:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231764AbiHaI53 (ORCPT ); Wed, 31 Aug 2022 04:57:29 -0400 Received: from fornost.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95F18CE489; Wed, 31 Aug 2022 01:56:51 -0700 (PDT) Received: from gwarestrin.arnor.me.apana.org.au ([192.168.103.7]) by fornost.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1oTJWe-00H5xj-Sc; Wed, 31 Aug 2022 18:56:46 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Wed, 31 Aug 2022 16:56:44 +0800 Date: Wed, 31 Aug 2022 16:56:44 +0800 From: Herbert Xu To: Ignat Korchagin Cc: "David S . Miller" , linux-crypto , linux-kernel , kernel-team Subject: Re: [PATCH] crypto: akcipher - default implementations for setting private/public keys Message-ID: References: <20220729165954.991-1-ignat@cloudflare.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Aug 30, 2022 at 11:48:23AM +0100, Ignat Korchagin wrote: > > I vaguely remember some initial research in quantum-resistant > signatures, which used HMAC for "signing" thus don't have any public > keys. But it is way beyond my expertise to comment on the practicality > and availability of such schemes. We could always add this again should an algorithm requiring it be introduced. > I'm more concerned here about a buggy "third-party" RSA driver, which > may not implement the callback and which gets prioritised by the > framework, thus giving the ability to trigger a NULL-ptr dereference > from userspace via keyctl(2). I think the Crypto API framework should > be a bit more robust to handle such a case, but I also understand that > there are a lot of "if"s in this scenario and we can say it is up to > crypto driver not to be buggy. Therefore, consider my opinion as not > strong and I can post a v2, which does not provide a default stub for > set_pub_key, if you prefer. If you're concerned with buggy algorithms/drivers, we should ensure that the self-tests catch this. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt