Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6146831iog; Thu, 23 Jun 2022 12:18:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vOlA9jhlluP9aRrFX1JdyL0O5gTiEVWnyjFe4zz4CX5hfGuvUCT1h4v8vWWAYzdewUAzcd X-Received: by 2002:a17:906:5343:b0:722:ea54:fe67 with SMTP id j3-20020a170906534300b00722ea54fe67mr9740578ejo.181.1656011918851; Thu, 23 Jun 2022 12:18:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011918; cv=none; d=google.com; s=arc-20160816; b=eQVba67qbKRRZ00ufTR5956SZ8bppWq8xtnHrln7dpXRtAzEervCLbirnxDAIkYJ2r m5HNdQXJiGI08CDaz+DhlLNN+DWTVazei1J1zTmEkqnai9VyJy2Z2Ebno8tCMfeQkBr6 1rZyjiZVmDho+sH7l4k2FesL5lpEmA8z0FCC9f2U0ocmwD5MpazYqA+/6/b5Dbsc8uaU hjIWU9ayMZ4zpwFYEMYTdnC7xPScZdx1xsmJF7434Hqo5PBDV0t5bNg8rZmJewAmQQ9B aLWoKJ1q+pQp/wBXOkfYaItek1dOEdrTG/l07v+JgojIWvOtv4CHlalYVow6UBaxGeWM IQCA== 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=SgS1XCp8jtMso3f1D1cQiejH7Gsgvl2RAmEtNkppsfI=; b=QRjLgBY9B0ob2s5JEyRjd74dKJcFjtZLijoh3MXrHe/YNStEnP+qPQrx1dyR7aQIO4 /mk8gtreL66tW0+ot+/wNvSRs4D2Tjpn3QbNjVikYkG8boek1U9bumK4gxGd4cer7twp mJAT7G9VtK5FFgjJYfgn/iNUgQDCtqloNm7vNFzkbyiCSOCtDvqtiP93tn0ta8MvPybY id1PtAs6ZuDtce7c44z67yr8fvQQs6WKDp6Do/BXgjV4p18p5lCuwx4ljLsm8D2EFwzF yyupmb4xUxs0k5V2Heb1+HqiQO6SKygJ+gKCSjTGpLtaEi+/eCfcvIiGzW84ZQacOSFW +v9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=w2HtYg+y; 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 j15-20020a05640211cf00b004356df8591csi475507edw.373.2022.06.23.12.18.13; Thu, 23 Jun 2022 12:18:38 -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=w2HtYg+y; 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 S235873AbiFWSFg (ORCPT + 99 others); Thu, 23 Jun 2022 14:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235745AbiFWSEM (ORCPT ); Thu, 23 Jun 2022 14:04:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7859EB85AA; Thu, 23 Jun 2022 10:17:23 -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 6AD8C61DB6; Thu, 23 Jun 2022 17:17:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D252C341C5; Thu, 23 Jun 2022 17:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656004641; bh=y66o9BTVBkbK+F/NodmtUgMmHUzfj/z/NRAOGSJy/Ac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w2HtYg+y4pIz1UobrVJdkYpOwlZtGpvHwNQ0iv0K4km/0mfgBtcZmzQWjcwk50H3x /mdvS9pcyOJDZ3X3OtSo11nzVDO2AcdVLy0UfHXxr22QXrEdOcqdz9dlUmjF5MQJEt Rl/+a1deSIIzv1Kl6mC/dq4UXmIxYmGpg6AwU3pw= 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.19 103/234] random: group sysctl functions Date: Thu, 23 Jun 2022 18:42:50 +0200 Message-Id: <20220623164345.973793097@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: "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 @@ -1686,9 +1686,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. * ********************************************************************/ @@ -1696,8 +1721,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]; @@ -1755,14 +1780,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,