Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6145624iog; Thu, 23 Jun 2022 12:17:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u7At3EJv8eol6zTstRjwmgijDaaeHPLK9zrofnk/HoV+f9pMxF1X300L6i9yqNHIsfZRhd X-Received: by 2002:a17:906:7948:b0:6f7:d5a3:3b91 with SMTP id l8-20020a170906794800b006f7d5a33b91mr9693755ejo.354.1656011830843; Thu, 23 Jun 2022 12:17:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011830; cv=none; d=google.com; s=arc-20160816; b=fgo2RGXvC9DGp2uAaBk1RyUwkAElBs7Q4q1z9OAEgUfRX//lprj9AD0Kff8jXv+Q53 mf+5w9xqr/nygtJHqdGT3h1AdBPGa5mTpk0HV1BfD0GEs1sGboF7Ueyr2dbhWk6pxuyk mOjJ64vpOh0ufRHDGy+7xh9ZQuq2MZlyqxlsukaXBai+MXCHPomaEMkn00rjtEDy1w0A yLDqjoToBp2MU2K6NzwzEysN/eje2rUopJ5TLlP4aI6VBRgden/wcBPmboEqvY98hiF3 TnqRB06Jf94MmmQn4mPzIqTkhFmD37sU0odIE2MEuj+V/mdHvOA45FANhAf/mOD3UyYN 84aw== 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=rk+26yOaEQ25xgyvPWN/nnA5OG3RdsziuHxVvTo5/iA=; b=XMzQedFKKsCR//bgCPyemZ4WgmVTt5g1+mRLi7jc7sa41KA9zVP8LAl/47LTis+2bu FexB/jjJsZNCpIfhNrPGetLLJZ7GtaiQB6ZkXpqikK5Ka4fhCn2/xwEwzuzhPe49WBSM Vu+8SWC+XeAYIo3QFLk5vGBUkMWLXhyDemvKHIjqUrTpz3EZPj39eosuLhPA75jJP0Ab +1gRfeBypGRlW3nt24gK15T5EW/9bfYpOvoPETv/iTFvW83SQuo33Ixu0ZO8SLCt7Ca1 z3CG3tjt1uniWUTI8my+YuRmw6Zpbb2kYH1GTjoSY3bpWsRPm8Rx13qKE+ILIg7Q7oUP 8Vcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gtRnhQcx; 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 dt22-20020a170907729600b00706f6756863si28333530ejc.114.2022.06.23.12.16.45; Thu, 23 Jun 2022 12:17:10 -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=gtRnhQcx; 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 S229995AbiFWRRR (ORCPT + 99 others); Thu, 23 Jun 2022 13:17:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229691AbiFWRLn (ORCPT ); Thu, 23 Jun 2022 13:11:43 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B54BF127; Thu, 23 Jun 2022 09:52:05 -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 sin.source.kernel.org (Postfix) with ESMTPS id 1557ACE25D9; Thu, 23 Jun 2022 16:52:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00001C3411B; Thu, 23 Jun 2022 16:52:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656003122; bh=iexH45n1UCBUZSFUUqXfMQNbLQir1yKbNFUEDOxdp80=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gtRnhQcxj8FtRw8ppCRfo7PLYVHmAjwS+hArEipd40AMad0L8Q0y3ab6xfbP7rUWO WFYZDqZHqejJTN1fk3qsCooNcCCsUWG2OyAB8UdLF7wRlkDXjmOgT2DHZHpVfQn52w 3ZE3ShjciwC6X0+KIWXqJAQUz+m85PrcyD6k3zvs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Theodore Tso , Dominik Brodowski , "Jason A. Donenfeld" Subject: [PATCH 4.9 138/264] random: group sysctl functions Date: Thu, 23 Jun 2022 18:42:11 +0200 Message-Id: <20220623164347.970329553@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: "Jason A. Donenfeld" commit 0deff3c43206c24e746b1410f11125707ad3040e upstream. This pulls all of the sysctl-focused functions into the sixth labeled section. No functional changes. Cc: Theodore Ts'o Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman --- drivers/char/random.c | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1687,9 +1687,34 @@ const struct file_operations urandom_fop .llseek = noop_llseek, }; + /******************************************************************** * - * Sysctl interface + * Sysctl interface. + * + * These are partly unused legacy knobs with dummy values to not break + * userspace and partly still useful things. They are usually accessible + * in /proc/sys/kernel/random/ and are as follows: + * + * - boot_id - a UUID representing the current boot. + * + * - uuid - a random UUID, different each time the file is read. + * + * - poolsize - the number of bits of entropy that the input pool can + * hold, tied to the POOL_BITS constant. + * + * - entropy_avail - the number of bits of entropy currently in the + * input pool. Always <= poolsize. + * + * - write_wakeup_threshold - the amount of entropy in the input pool + * below which write polls to /dev/random will unblock, requesting + * more entropy, tied to the POOL_MIN_BITS constant. It is writable + * to avoid breaking old userspaces, but writing to it does not + * change any behavior of the RNG. + * + * - urandom_min_reseed_secs - fixed to the meaningless value "60". + * It is writable to avoid breaking old userspaces, but writing + * to it does not change any behavior of the RNG. * ********************************************************************/ @@ -1697,8 +1722,8 @@ const struct file_operations urandom_fop #include -static int random_min_urandom_seed = 60; -static int random_write_wakeup_bits = POOL_MIN_BITS; +static int sysctl_random_min_urandom_seed = 60; +static int sysctl_random_write_wakeup_bits = POOL_MIN_BITS; static int sysctl_poolsize = POOL_BITS; static char sysctl_bootid[16]; @@ -1756,14 +1781,14 @@ struct ctl_table random_table[] = { }, { .procname = "write_wakeup_threshold", - .data = &random_write_wakeup_bits, + .data = &sysctl_random_write_wakeup_bits, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec, }, { .procname = "urandom_min_reseed_secs", - .data = &random_min_urandom_seed, + .data = &sysctl_random_min_urandom_seed, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec,