All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Kitt <steve@sk2.org>
To: Luis Chamberlain <mcgrof@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	Iurii Zaikin <yzaikin@google.com>,
	linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Stephen Kitt <steve@sk2.org>
Subject: [PATCH] sysctl: const-ify ngroups_max
Date: Mon, 18 May 2020 17:57:27 +0200	[thread overview]
Message-ID: <20200518155727.10514-1-steve@sk2.org> (raw)

ngroups_max is a read-only sysctl entry, reflecting NGROUPS_MAX. Make
it const, in the same way as cap_last_cap.

Signed-off-by: Stephen Kitt <steve@sk2.org>
---
This is split out from 2f4c33063ad7 ("docs: sysctl/kernel: document
ngroups_max") which conflicted with f461d2dcd511 ("sysctl: avoid forward
declarations").

 kernel/sysctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 349cab382081..cc1fcba9d4d2 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -133,7 +133,7 @@ static unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
 static int maxolduid = 65535;
 static int minolduid;
 
-static int ngroups_max = NGROUPS_MAX;
+static const int ngroups_max = NGROUPS_MAX;
 static const int cap_last_cap = CAP_LAST_CAP;
 
 /*
@@ -2232,7 +2232,7 @@ static struct ctl_table kern_table[] = {
 #endif
 	{
 		.procname	= "ngroups_max",
-		.data		= &ngroups_max,
+		.data		= (void *)&ngroups_max,
 		.maxlen		= sizeof (int),
 		.mode		= 0444,
 		.proc_handler	= proc_dointvec,

base-commit: bdecf38f228bcca73b31ada98b5b7ba1215eb9c9
-- 
2.20.1


             reply	other threads:[~2020-05-18 15:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18 15:57 Stephen Kitt [this message]
2020-05-18 16:08 ` [PATCH] sysctl: const-ify ngroups_max Kees Cook
2020-05-18 17:25   ` Luis Chamberlain
2020-05-18 18:17     ` Kees Cook
2020-05-18 18:30       ` Luis Chamberlain
2020-05-18 21:14         ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200518155727.10514-1-steve@sk2.org \
    --to=steve@sk2.org \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=yzaikin@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.