Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6134487iog; Thu, 23 Jun 2022 12:04:26 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tT0ngS67pv9QRrqw0x+vprdKPLrsUq4U7mZzHb5DFg9cpeLwu0HBP9En5GPXKc5s5HBSjU X-Received: by 2002:a05:6a02:201:b0:3fc:6071:a272 with SMTP id bh1-20020a056a02020100b003fc6071a272mr8812184pgb.518.1656011066756; Thu, 23 Jun 2022 12:04:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011066; cv=none; d=google.com; s=arc-20160816; b=jFk9bpdSjGx8f0ck0wbzFEi4tXMMsPPg8upe8OV9GQzlHzOPHENfHRrUh2LvkVQs7t r/a3SAopIo2+nqtcJRVXJv+aoGgIGdoKUIOEKdxTd8cWEPSMm/lXdbhZ/vjPfBPiSy3F MsutOaU78uLtFT4kS3XyR5uybWER6sotqLmGWvgDahwnDBpCOn1BFh7he+hOF6KuB9a5 Cp8x/CJxrMOKH8YmtcLiXHAUe3IPnlZeP8mukrZgTV8umkHGXrwDaaVzcbNZlcqrRN8p ATIau4I58wh5BXhtrNSO2WEOdGr4vi1/YFXaeMUR/S3KE3D6TQy5Xopsm3/k46oflA8s 3i3A== 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=i4keFN0BKkKVAPDm2wUKtOc1fcS59uuvHeXKh/0/aVrQAvKUc3Derxda5z60blO0GU tNyHs1z1ZiNMr6PGu1lJGp4OEBwtkiiEC48YWcezp7OzKSbrVmaWtj5fvXPS7ZE3nkvV h5lwnUnb8ZarOUO57R0uPudI/MYassjvMOgDrEvABpehDx+SjphOBQVDokaG/7Z3blJo sa27b4tx+HhHd3Llb7z7IcQB3lbkNtPuqDM5+zp9ZdXZpcba8wKbvRMI34NZIaZ/bXVv YHNpOzaMBCE9SFSvbgZPd8VJIr+D9PHYciNxD7NVy/jQsiZGmUmugAxw55Ad/tpvI90V CLnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="tU3/mCT6"; 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 t6-20020a170902e84600b00153b640ed90si472435plg.38.2022.06.23.12.04.15; Thu, 23 Jun 2022 12:04:26 -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="tU3/mCT6"; 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 S233357AbiFWQ5p (ORCPT + 99 others); Thu, 23 Jun 2022 12:57:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233614AbiFWQvR (ORCPT ); Thu, 23 Jun 2022 12:51:17 -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 0AD454F446; Thu, 23 Jun 2022 09:49:21 -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 5F87361F90; Thu, 23 Jun 2022 16:49:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47524C3411B; Thu, 23 Jun 2022 16:49:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656002960; bh=N5fiw4PejwCrYvciUGPEH44DfCxU/YsYTR0gRKooOCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tU3/mCT6AAc88zBhX6CSnX3cNwFP3O+w8Ml7UoVbwKHoEkfu74BcgkrhqEVowt9mg 4mm4kKcO17UW2KRAtWHPeZd6bm0db21+GlfvlcwImMgRNtSOc9KsGo3jEiXHPI9MK4 rPlUlFHQHxHy2D+1FBM3NPRERnMUM8LpzEFWRZ6o= 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.9 081/264] random: document add_hwgenerator_randomness() with other input functions Date: Thu, 23 Jun 2022 18:41:14 +0200 Message-Id: <20220623164346.362104869@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164344.053938039@linuxfoundation.org> References: <20220623164344.053938039@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 * ============================================ *