Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1582841rwb; Mon, 7 Nov 2022 03:27:34 -0800 (PST) X-Google-Smtp-Source: AMsMyM5hr5FtTqhTpoEKbggtRtA9G2kst3fsILIPalPn/xj1VagWxgK9mmziEIKBQnaPQS5SRJ20 X-Received: by 2002:a17:902:ab45:b0:186:7b95:f767 with SMTP id ij5-20020a170902ab4500b001867b95f767mr51050406plb.107.1667820454282; Mon, 07 Nov 2022 03:27:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667820454; cv=none; d=google.com; s=arc-20160816; b=izjlZoXIpD+pU8xFA5LrSU2DacKQn80gAu8WVWBl1hJfWgP9BZGLH6C+XZVjKVgcLC thZ5GE5O5hqTZnP0dFdZCRshf89EO4/Dm8QutXXAmKc+8lcL4dL9CQs3egtDAjBETJgX igbENjEmo8atVqN+/yM+mzFrB7PFQcbwsWp4grqgC8yNT7cS1/1/XIxPvziJR/3KPHuA jijwvoB+ZtHGaoZnZghFj5XiBANrQFCIW4Lf/o0o1wexpXkwK8mOKFynmRUps4rNC8f7 TvKAiBPxPNZYYA7HRPQZXcX8dIG9pQZxCzl/E4PwjR7N6E/9RcOLuUA0vwplrj8uZBvr mZ3g== 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=s7U86p4AtvwDins/lcZYBv//WqfDek01ql6jIET96E4=; b=K1YQ4LP6uVCb5hBGg4CsgsFwkPo/WiqAOwAvAZ8yI5zrjXwopkU7tv7M9Z9n/TuDXi Fe9idFD2WZNJGxm2g0+CD52iSDqTk7IE8D8uWfkbQTmUeHAOqfZmpAa1EEnC7awH+gGZ 3PfEDqHdFgQ2kPUVMD9nAwJj/Azt7l460CB7m85YcuyOo66Xgwygpkz4wEyDJ8ZaK6bT hvyrnEa1HdrFv2ZvHE5116r9zf5hs4CgywBbG2NmO0hGcw/MyUbYCfXUVtcaJlAwqDFB zvsRuBdkSn4Gi7+Bo16hY20JD+nYskEluaMzB1gKJlveWl2yt/nkLuI8/VmkYI3W9pu6 7TEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=SjDbBwDa; 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=QUARANTINE sp=QUARANTINE 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 i3-20020a635843000000b0046b3dce845dsi9731595pgm.470.2022.11.07.03.27.20; Mon, 07 Nov 2022 03:27:34 -0800 (PST) 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=SjDbBwDa; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231193AbiKGLSO (ORCPT + 99 others); Mon, 7 Nov 2022 06:18:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229659AbiKGLSN (ORCPT ); Mon, 7 Nov 2022 06:18:13 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74C7AB1F5 for ; Mon, 7 Nov 2022 03:18:12 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 3310EB80E15 for ; Mon, 7 Nov 2022 11:18:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C1B7C433C1; Mon, 7 Nov 2022 11:18:09 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="SjDbBwDa" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1667819887; 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=s7U86p4AtvwDins/lcZYBv//WqfDek01ql6jIET96E4=; b=SjDbBwDaxhyjBcKA+KlTxh+/it5r/XSlZWhFUqZuOKzyZcBsxPP88sFLaOb7Nk6N7zqCo7 TjLjC6c5iJLs9+xVUAxdYUs0hTepi/UVrE6jivMK0YC6xTlpPIkjigqnNOrYfhjFrLjPCS EwqghD0ttB7ElvWXNtkZgiNqX57cSOU= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 0dd01ac2 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 7 Nov 2022 11:18:06 +0000 (UTC) Date: Mon, 7 Nov 2022 12:18:04 +0100 From: "Jason A. Donenfeld" To: Harald Freudenberger Cc: herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org, Ard Biesheuvel , Holger Dengler Subject: Re: [PATCH] hw_random: treat default_quality as a maximum and default to 1024 Message-ID: References: <20221104154230.52836-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 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 Harald, On Mon, Nov 07, 2022 at 10:24:42AM +0100, Harald Freudenberger wrote: > Well, I am not sure if this is the right way to go. So by default a > hw rng which does not implement the registration correctly is > rewarded with the implicit assumption that it produces 100% of > entropy. > I see your point - a grep through the kernel code gives the impression > that a whole bunch of registrations is done with an empty quality > field. What about assuming a default quality of 50% if the field > is not filled ? The vast majority of hardware RNGs do *not* work this way. The reasonable assumption is to assume that a hardware RNG provides fully random bits, unless the documentation leads the driver author to specify something less. Really, just quit with all the nutty mailing list stuff here. Next: "how about 74.4% because that matches the vibrations of cedar trees"... If you want this to be different on a particular kernel, you can set your exact value as a command line. This patch here is simply about a sensible default. Jason