Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2933770iog; Mon, 20 Jun 2022 07:47:18 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s8nVxdyz1hseCB5XUsawRWw4nVCip7S/Cq1WyzBX0sAbxXrJx9z56VyW28yRTK1PTpKdGn X-Received: by 2002:a17:902:6b42:b0:15d:3603:6873 with SMTP id g2-20020a1709026b4200b0015d36036873mr24189016plt.30.1655736438447; Mon, 20 Jun 2022 07:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655736438; cv=none; d=google.com; s=arc-20160816; b=Gi5BwuEK82826sSYPRWp9MLBqDsuztImmYqxmdUP0Piv6tg6JlOHUMWZy/3+8mWhw+ teLDnrNDsi/NmMaz9Jo2efP7HR6QaZugbNstm9l6FnoZy1DYDfnMuPd54BhR57kfimzf z04RknDOYO5S6DlXDwaiz4SbI1RwxQOyN2DKM1CIyCYeGm667M+u5cQ9RD1k9XO52H/M PkdulXBd5rxpXOslJRGq+KN+B59PnJr8ywAOjgtgoGjb3cdVaxjH6JUTSZx4CTq1qp1j CkgimcRdu1VXaR+6AX8H5sIMZndh9h9qPbZg/dwlA22L2QpmY0hI9rKMxKSjlgKhBwVa j6Ug== 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=d/VqOnSAK/iMlB42hWW4kUHhUN63zoKNuMrBDrq0Koo=; b=vDm1NfuUrR4tsAYT/kaOHRRQp9ET8vfkGrKOIm8BmW/3Ku3W4/ibhfcKXuoPUy6UvO ajGVNTyOCrOIgwKPC41aU4F7FCih7HIVbcRIozrCumN+FBeQqrI1NavEButFhgMnuH7X U7hzKvkaZ+r/QPG1+yX+fIhFUuVZ3o+Q0FN3J/IaNDbNNth6KbWoKFxb4jI5a73G/U/9 VjnFge8AabXSEtfy9MnOykeB4aLCfCH6QWbqh9CBoUT6oa5gmSobylc99A8uFL8ctAgA HJ6dIjpM9hwcca9TNNNL4qOU8sn9L8MuPGOgyASuMLiC7orXyTSmWTHkiTphZqLlgSNM FpTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zCPymmLA; 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 f126-20020a636a84000000b003fc6b3c8274si15059308pgc.16.2022.06.20.07.47.06; Mon, 20 Jun 2022 07:47:18 -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=zCPymmLA; 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 S1347448AbiFTNpT (ORCPT + 99 others); Mon, 20 Jun 2022 09:45:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347788AbiFTNnS (ORCPT ); Mon, 20 Jun 2022 09:43:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 510FA2019B; Mon, 20 Jun 2022 06:15:46 -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 D41EE60ECD; Mon, 20 Jun 2022 13:15:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC0ABC3411B; Mon, 20 Jun 2022 13:15:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655730927; bh=iyc7IzqEY4cu1aFinMETBs5zvM/9ceRnpNno5ZFows0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zCPymmLAtw/aUTMcoJ+1u8+QjaKsUxykdVLtwO256p/GHENVMOpLTQzMDFotzVTFh KZh0i+/WpukdsIS9OBobJ4h7HFMEwCXU51OP86MUanoXNayIcPeqgib0bjFzHKZeDg tg1Gmk76ynx51bG1ZoDmqGYVOyDIRWrm66UT15js= 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 5.4 098/240] random: group sysctl functions Date: Mon, 20 Jun 2022 14:49:59 +0200 Message-Id: <20220620124741.856092000@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220620124737.799371052@linuxfoundation.org> References: <20220620124737.799371052@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 @@ -1688,9 +1688,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. * ********************************************************************/ @@ -1698,8 +1723,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]; @@ -1757,14 +1782,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,