Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp50133iob; Tue, 17 May 2022 18:22:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwStZtT+yCnU8fPxHD5MQO+AOvwWISOcQBuzETBI8BFLlT+G8qDAR1hqEoD9xxVDlsXh6Jx X-Received: by 2002:a17:902:bc8c:b0:15e:c103:940c with SMTP id bb12-20020a170902bc8c00b0015ec103940cmr24294523plb.154.1652836943143; Tue, 17 May 2022 18:22:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652836943; cv=none; d=google.com; s=arc-20160816; b=pOzRtU8eS/0EB6LrEvFHdugqLq4QKInqRiRgd/B708hq0/nKBVL8HuUDX2SqxK8Vlb oHml446L+2dobIOFAjJhzUNUCc6VX2MgY7/Th8cAsk5ImaNk++/O7D5U9F+mP7oziqm1 cK6QaLKEspu1T4XNHP7gpYix3etf672iZskOo+2SAAeFU32u8B94QkxL1TmB0oW1cVLT xlL3wvmSQpWn+0M/J53RJJXqkrBItHcpH3TrjWPmiOLCT63kNJkZZGcInncJ+k/7DJzZ olf/cTZ/DM+W+YBG0/vO4ViiWVOa1pdqDeewOqWEsk8NujSCtydK1dBxUWwfCGpaYExg 3EMg== 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:dkim-signature; bh=DIvWyHfOQIR1tPAdB9mF+GPuZBnqjHJbDDlA9qL55rA=; b=A47gVV2MxicEr5ym4pF1QcRETJhV6/8zGG7kIoyuKj8HYp9cNczX1ffMVHDHKYkmO4 F3D7u/LjJ8z6zqjGQRxfWO//lGV56xTGxW4myWxBNarE+UXH/m4NIMeLY6m5xVuXW2cX TCgTJ20+dCmJ2rffzlx4286mbXyVnM8cGGQbDcVHDQKNIlKx9n8QwWk2+dfmf1bWEpoL kkTOhZ6+OwIy3IEAqq2mo+UsUFjYJbDkY0Oj23pPmS8HACqspl1q5Pr8Wn7sY9FvsbGT NxlkgMk9TNeKn938ZY1fY1Bjsk1tSwASFzneVbNO8OIMzIAzAU2H8Ofc7G9ycTdqKX/F SOdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=IWaU0P9Y; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bh2-20020a056a02020200b003db2e6e3c5dsi758459pgb.707.2022.05.17.18.21.57; Tue, 17 May 2022 18:22:23 -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; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=IWaU0P9Y; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351706AbiEQSBM (ORCPT + 99 others); Tue, 17 May 2022 14:01:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351724AbiEQSBD (ORCPT ); Tue, 17 May 2022 14:01:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8DCC38DA7; Tue, 17 May 2022 11:01:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D5F7861475; Tue, 17 May 2022 18:01:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4C14C385B8; Tue, 17 May 2022 18:00:57 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="IWaU0P9Y" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1652810456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DIvWyHfOQIR1tPAdB9mF+GPuZBnqjHJbDDlA9qL55rA=; b=IWaU0P9YKirAbyAX2ryUkPQEA2hxEes0Y3qkw4mt+f8Cgoci+m4YJBKKeQMoXBV9PoUhoO GpySOT4hW+NN0ZjwRCALfKVgGdXUqAKdVug0vEuomby3JhkiHBqTcJi9f4PfGqo0OYmcmT XTqCCA6DFbm5vzXk+2GZBFZsadB6B2U= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 8ca48184 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Tue, 17 May 2022 18:00:55 +0000 (UTC) Date: Tue, 17 May 2022 20:00:45 +0200 From: "Jason A. Donenfeld" To: Ahmad Fatoum Cc: James Bottomley , Jarkko Sakkinen , Mimi Zohar , David Howells , kernel@pengutronix.de, Sumit Garg , Pankaj Gupta , David Gstir , Michael Walle , John Ernberg , James Morris , "Serge E. Hallyn" , Horia =?utf-8?Q?Geant=C4=83?= , Herbert Xu , "David S. Miller" , Jan Luebbe , Eric Biggers , Richard Weinberger , Franck LENORMAND , Matthias Schiffer , 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 Subject: Re: [PATCH v10 2/7] KEYS: trusted: allow use of kernel RNG for key material Message-ID: References: <20220513145705.2080323-1-a.fatoum@pengutronix.de> <20220513145705.2080323-3-a.fatoum@pengutronix.de> <21250bc0-623b-f11d-7dbf-458d144b7963@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <21250bc0-623b-f11d-7dbf-458d144b7963@pengutronix.de> X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,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 Hi Ahmad, On Tue, May 17, 2022 at 07:52:51PM +0200, Ahmad Fatoum wrote: > Hello Jason, > > On 17.05.22 19:27, Jason A. Donenfeld wrote: > > On Fri, May 13, 2022 at 04:57:00PM +0200, Ahmad Fatoum wrote: > >> + trusted.rng= [KEYS] > >> + Format: > >> + The RNG used to generate key material for trusted keys. > >> + Can be one of: > >> + - "kernel" > >> + - the same value as trusted.source: "tpm" or "tee" > >> + - "default" > >> + If not specified, "default" is used. In this case, > >> + the RNG's choice is left to each individual trust source. > >> + > > > > As a general mechanism, I object to this. The kernel's RNG must be > > trusted in the first place for key material. That's the whole point of > > it. > > > > However, it sounds like you're not proposing a general mechanism, but > > just something particular to this "trusted keys" business. > > The two currently upstream trust sources (trusted key backends) each provide > their own RNG callback. This series adds a third backend that uses kernel RNG > and additionally provides users of the two existing trust sources the option > to benefit from kernel RNG as well. > > > this should be a module flag, and thus not documented here, but rather > > some place namespaced to your trusted keys stuff. "trusted_keys.preferred_rng={whatever}" > > The trusted keys module is trusted.ko and directly before my added lines is > the trusted.source= documentation, so I think this is already at the correct place. My apologies; I should have looked at the file itself instead of just relying on git line context. You're right, the module itself is called trusted.ko. This is confusing (shouldn't it be trusted_keys or something?) , but what you propose sounds consistent from a namespacing perspective with what's already there. Jason