Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4257984pxb; Mon, 21 Feb 2022 16:11:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUECzbFxjQLqE9rRDibpiLdN7+c0JpsiSWnLNfs1GIn0Q+oCj3yFpbojYX1wxFpZP2XdOh X-Received: by 2002:a05:6402:27cc:b0:412:eb0a:b687 with SMTP id c12-20020a05640227cc00b00412eb0ab687mr11695231ede.208.1645488682643; Mon, 21 Feb 2022 16:11:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645488682; cv=none; d=google.com; s=arc-20160816; b=efa5u8vjEtzi96FjJXwmm2zjVJcuErzIIYBlO1mRqGp5PlHLYu4Nw9M5lSAPcdMuxj nZAv3C1IsShY4mk75+3L3uTmM7QqbEgtnuxrLZdQ7bB2Oiu/rFpDH7PSpr0iH80F6GOV VA2YLr3VNVvXnSxbCqymk/HbmDBkZS3Fyk1J6N1YGVWhW4ngXgcQ6C2QpClw3DrZJuyO syrPUX5TadqnE+Pgmt/9ayPSDygI2HZNOKiPCHw7vbD80NBrEe6B6OILsPrLC1JGMs8v paVo4pSIJCvp0EKn64Tphr0aZGXPdBKx8ERJ/fgbt6Ofglq+rGtNG2Xxd5A4cqeUmqrG T6Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=RQqwLIRqBF6IyJA8RF+kEDk7RrKOa7nHZ2TpMJ5iw60=; b=w9KzuOIxfSVX9azg9Upjn6iAjbWzOsW36npdchF1uHbBHgYUHuNVEY2mBXuuEsqmSS 20DggRymkamk3WQmqnZXKNIPOepjhrJQJbRWLPe1U34Yp1CBd+b1L0rK95GUQ7MuQx46 NEpbmynJnR3g9b/fwdYaxx+fU997X+lz/7wxk6LnkEjqXUowGOdx3DV6ZBIYpmqUF3uw UwvX22PuEgFxniVP0e4OIMgWDhXxxMMnZXI872uV4Ulni6GEQhadykROXMk4N9duwCyM kzfDYp9iIbsZjU9Cf+QJbF5WzP6zTQuyXwh/35s8OUfdhCy9+bGZ5vPdxlnW55QZIRhD rVrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=F1zazOBT; 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=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j6si9221471ejj.282.2022.02.21.16.11.00; Mon, 21 Feb 2022 16:11:22 -0800 (PST) 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=@zx2c4.com header.s=20210105 header.b=F1zazOBT; 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=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378964AbiBUPSH (ORCPT + 99 others); Mon, 21 Feb 2022 10:18:07 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:35100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235434AbiBUPSF (ORCPT ); Mon, 21 Feb 2022 10:18:05 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DE471DA72 for ; Mon, 21 Feb 2022 07:17:42 -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 4D5A3B81216 for ; Mon, 21 Feb 2022 15:17:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C579CC340E9 for ; Mon, 21 Feb 2022 15:17:39 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="F1zazOBT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1645456658; 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=RQqwLIRqBF6IyJA8RF+kEDk7RrKOa7nHZ2TpMJ5iw60=; b=F1zazOBTR9OUFsDoxxY30c4zIb3qZv1Vjy7v9LeaDCE/HMYs8wqPshpfiJjNRm6cAtPDjZ mrbi7S9dQlRv9QpoXr5OnOK8MO4oTc40OwjanTk/pjpa3W5CnmosRCaZKxFHbH3qdAIHaw 1ivICK0GZy3G7Fz21n/VhXc643lHawg= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 886fdb3a (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Mon, 21 Feb 2022 15:17:38 +0000 (UTC) Received: by mail-yb1-f174.google.com with SMTP id j2so35201149ybu.0 for ; Mon, 21 Feb 2022 07:17:37 -0800 (PST) X-Gm-Message-State: AOAM533vtrxrvdwdiPAbF4B91Qa1IOonmi8N6nYVT3hbdUSkL3C0bCRo AyN0Vo4/1Va8wbfLYt8AzWfCbm9C9xtrEHPbnsY= X-Received: by 2002:a25:d116:0:b0:61d:e8c9:531e with SMTP id i22-20020a25d116000000b0061de8c9531emr19182794ybg.637.1645456657044; Mon, 21 Feb 2022 07:17:37 -0800 (PST) MIME-Version: 1.0 References: <20220212122318.623435-1-Jason@zx2c4.com> <20220212122318.623435-8-Jason@zx2c4.com> In-Reply-To: From: "Jason A. Donenfeld" Date: Mon, 21 Feb 2022 16:17:26 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 07/10] random: group entropy collection functions To: Eric Biggers Cc: LKML , Dominik Brodowski , "Theodore Ts'o" Content-Type: text/plain; charset="UTF-8" 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-kernel@vger.kernel.org On Mon, Feb 21, 2022 at 6:13 AM Eric Biggers wrote: > > On Sat, Feb 12, 2022 at 01:23:15PM +0100, Jason A. Donenfeld wrote: > > +/********************************************************************** > > + * > > + * Entropy collection routines. > > + * > > + * The following exported functions are used for pushing entropy into > > + * the above entropy accumulation routines: > > + * > > + * void add_device_randomness(const void *buf, size_t size); > > + * void add_input_randomness(unsigned int type, unsigned int code, > > + * unsigned int value); > > + * void add_interrupt_randomness(int irq); > > + * void add_disk_randomness(struct gendisk *disk); > > + * void add_hwgenerator_randomness(const void *buffer, size_t count, > > + * size_t entropy); > > + * void add_bootloader_randomness(const void *buf, size_t size); > > + * > > + * add_device_randomness() adds data to the input pool that > > + * is likely to differ between two devices (or possibly even per boot). > > + * This would be things like MAC addresses or serial numbers, or the > > + * read-out of the RTC. This does *not* credit any actual entropy to > > + * the pool, but it initializes the pool to different values for devices > > + * that might otherwise be identical and have very little entropy > > + * available to them (particularly common in the embedded world). > > Perhaps this comment should match the order in which these functions are defined > in the file? Sure. Will do