Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6140068iog; Thu, 23 Jun 2022 12:10:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v+PHG7PXNWJ/RH4dYpfXNgmswiJFstT2oFu8jD1/J2yPuL06DrnPc6iNPnQBLX3V9VuGM+ X-Received: by 2002:a17:907:3e93:b0:722:abe1:26cb with SMTP id hs19-20020a1709073e9300b00722abe126cbmr9630783ejc.562.1656011445702; Thu, 23 Jun 2022 12:10:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011445; cv=none; d=google.com; s=arc-20160816; b=qjUP959/LxW5wReTZX1gFhwHWBAVP3bA2CiVNAZBATAn6/s7iQSs3mHPawMYhpPH4h QWlPipHPtOjmIR2YaKXuM8M6pz2CHNJ1Uyvxp0MHkKCHlst7B0tU9CwjLKSgFO7kWCyi gf/0k27jtSg0exVi7FLfitBPoArk/3jygSU+jMpad86Tc5bAgN2A/P7iKQ0SSEuCilyx xQLCiB5FUfoc+GJ8JujNvJy6w/pDqmXJYZ6R2EHehPwlAv5Rxq3PRXxRH3k+OrF4V2Ip Nhv9k648yw/BdJT1OMxdpXeWtNRBVOz9cJzJkV6cChpwttzfbpQH7zVTRiEPuoQ7U1kU /WFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uueyTH2YhI9e/mJmSP55oIkWnPtnz+Wji6z16vfv5uw=; b=jxU0sUJ4xfzqN7Ae0mumj/kzXlYPCmRI2Pk7nvF65nfi+wGjIZixTaQ0ORVi0SD3/L dcmtMj+4L10tzHN4zdJI6RY+JHeqMAoyC81Hoimnn6WwSYtHdNVpC3+ZmqnMRJxqQLES p681F0jv7gyCZdeWvXHmsgNBOntbZ/v/Ncmttffs5mY4OvusQTZ0sd8slbmCMeQkD6To 1Kz+fcjxXTDRM18adnYwUR5vbbyBAFMKPmWih30d94vs2W1N90/hsukqeZy8kKbqr6Pz zIakGlxAym1R+bvz0oeY3l3j7V3NKPPPnli/Vq/HaQs49NAT8Sj+OgaUwstnMNcq+xeM igpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aTxB6+wi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa37-20020a17090786a500b007121c97d1d4si596533ejc.947.2022.06.23.12.10.20; Thu, 23 Jun 2022 12:10:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=aTxB6+wi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235621AbiFWR4z (ORCPT + 99 others); Thu, 23 Jun 2022 13:56:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235960AbiFWRxk (ORCPT ); Thu, 23 Jun 2022 13:53:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04215ABA62; Thu, 23 Jun 2022 10:14:28 -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 316636159B; Thu, 23 Jun 2022 17:14:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EAFD8C3411B; Thu, 23 Jun 2022 17:14:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656004467; bh=N5fiw4PejwCrYvciUGPEH44DfCxU/YsYTR0gRKooOCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aTxB6+wi4muJjg+PI3rqlcBs0Kbu+HCjGH54QwfkXVYgYnLdRvwnl+3g+11vrdw6u LnlF+NwDqRZZYw9dlz/gysc3ULpeOP52zCkqK0kbKslU+I11/2nbtlPw6CoTkc7x6L TLtMqTCYiduhRq4d4vojcv1XMJ4iX9pV1Pwf8KLc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown , "Jason A. Donenfeld" Subject: [PATCH 4.19 048/234] random: document add_hwgenerator_randomness() with other input functions Date: Thu, 23 Jun 2022 18:41:55 +0200 Message-Id: <20220623164344.426289839@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164343.042598055@linuxfoundation.org> References: <20220623164343.042598055@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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-kernel@vger.kernel.org From: Mark Brown commit 2b6c6e3d9ce3aa0e547ac25d60e06fe035cd9f79 upstream. The section at the top of random.c which documents the input functions available does not document add_hwgenerator_randomness() which might lead a reader to overlook it. Add a brief note about it. Signed-off-by: Mark Brown [Jason: reorganize position of function in doc comment and also document add_bootloader_randomness() while we're at it.] Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman --- drivers/char/random.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -202,6 +202,9 @@ * unsigned int value); * void add_interrupt_randomness(int irq, int irq_flags); * void add_disk_randomness(struct gendisk *disk); + * void add_hwgenerator_randomness(const char *buffer, size_t count, + * size_t entropy); + * void add_bootloader_randomness(const void *buf, unsigned int size); * * add_device_randomness() is for adding data to the random pool that * is likely to differ between two devices (or possibly even per boot). @@ -228,6 +231,14 @@ * particular randomness source. They do this by keeping track of the * first and second order deltas of the event timings. * + * add_hwgenerator_randomness() is for true hardware RNGs, and will credit + * entropy as specified by the caller. If the entropy pool is full it will + * block until more entropy is needed. + * + * add_bootloader_randomness() is the same as add_hwgenerator_randomness() or + * add_device_randomness(), depending on whether or not the configuration + * option CONFIG_RANDOM_TRUST_BOOTLOADER is set. + * * Ensuring unpredictability at system startup * ============================================ *