Linux-Fsdevel Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] sysctl: const-ify ngroups_max
@ 2020-05-18 15:57 Stephen Kitt
  2020-05-18 16:08 ` Kees Cook
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Kitt @ 2020-05-18 15:57 UTC (permalink / raw)
  To: Luis Chamberlain, Kees Cook, Iurii Zaikin, linux-fsdevel
  Cc: linux-kernel, Stephen Kitt

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sysctl: const-ify ngroups_max
  2020-05-18 15:57 [PATCH] sysctl: const-ify ngroups_max Stephen Kitt
@ 2020-05-18 16:08 ` Kees Cook
  2020-05-18 17:25   ` Luis Chamberlain
  0 siblings, 1 reply; 6+ messages in thread
From: Kees Cook @ 2020-05-18 16:08 UTC (permalink / raw)
  To: Stephen Kitt; +Cc: Luis Chamberlain, Iurii Zaikin, linux-fsdevel, linux-kernel

On Mon, May 18, 2020 at 05:57:27PM +0200, Stephen Kitt wrote:
> 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>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sysctl: const-ify ngroups_max
  2020-05-18 16:08 ` Kees Cook
@ 2020-05-18 17:25   ` Luis Chamberlain
  2020-05-18 18:17     ` Kees Cook
  0 siblings, 1 reply; 6+ messages in thread
From: Luis Chamberlain @ 2020-05-18 17:25 UTC (permalink / raw)
  To: Kees Cook, Xiaoming Ni, Andrew Morton
  Cc: Stephen Kitt, Iurii Zaikin, linux-fsdevel, linux-kernel

On Mon, May 18, 2020 at 09:08:22AM -0700, Kees Cook wrote:
> On Mon, May 18, 2020 at 05:57:27PM +0200, Stephen Kitt wrote:
> > 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>
> 
> Reviewed-by: Kees Cook <keescook@chromium.org>

Kees, since there is quite a bit of sysctl cleanup stuff going on and I
have a fs sysctl kitchen cleanup, are you alright if I carry this in a
tree and send this to Andrew once done? This would hopefully avoid
merge conflicts between these patches.

I have to still re-spin my fs sysctl stuff, but will wait to do that
once Xiaoming bases his series on linux-next.

  Luis

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sysctl: const-ify ngroups_max
  2020-05-18 17:25   ` Luis Chamberlain
@ 2020-05-18 18:17     ` Kees Cook
  2020-05-18 18:30       ` Luis Chamberlain
  0 siblings, 1 reply; 6+ messages in thread
From: Kees Cook @ 2020-05-18 18:17 UTC (permalink / raw)
  To: Luis Chamberlain
  Cc: Xiaoming Ni, Andrew Morton, Stephen Kitt, Iurii Zaikin,
	linux-fsdevel, linux-kernel

On Mon, May 18, 2020 at 05:25:09PM +0000, Luis Chamberlain wrote:
> On Mon, May 18, 2020 at 09:08:22AM -0700, Kees Cook wrote:
> > On Mon, May 18, 2020 at 05:57:27PM +0200, Stephen Kitt wrote:
> > > 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>
> > 
> > Reviewed-by: Kees Cook <keescook@chromium.org>
> 
> Kees, since there is quite a bit of sysctl cleanup stuff going on and I
> have a fs sysctl kitchen cleanup, are you alright if I carry this in a
> tree and send this to Andrew once done? This would hopefully avoid
> merge conflicts between these patches.
> 
> I have to still re-spin my fs sysctl stuff, but will wait to do that
> once Xiaoming bases his series on linux-next.

Yeah, totally. I don't technically have a sysctl tree (I've always just
had akpm take stuff), so go for it. I'm just doing reviews. :)

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sysctl: const-ify ngroups_max
  2020-05-18 18:17     ` Kees Cook
@ 2020-05-18 18:30       ` Luis Chamberlain
  2020-05-18 21:14         ` Kees Cook
  0 siblings, 1 reply; 6+ messages in thread
From: Luis Chamberlain @ 2020-05-18 18:30 UTC (permalink / raw)
  To: Kees Cook
  Cc: Xiaoming Ni, Andrew Morton, Stephen Kitt, Iurii Zaikin,
	linux-fsdevel, linux-kernel

On Mon, May 18, 2020 at 11:17:47AM -0700, Kees Cook wrote:
> On Mon, May 18, 2020 at 05:25:09PM +0000, Luis Chamberlain wrote:
> > On Mon, May 18, 2020 at 09:08:22AM -0700, Kees Cook wrote:
> > > On Mon, May 18, 2020 at 05:57:27PM +0200, Stephen Kitt wrote:
> > > > 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>
> > > 
> > > Reviewed-by: Kees Cook <keescook@chromium.org>
> > 
> > Kees, since there is quite a bit of sysctl cleanup stuff going on and I
> > have a fs sysctl kitchen cleanup, are you alright if I carry this in a
> > tree and send this to Andrew once done? This would hopefully avoid
> > merge conflicts between these patches.
> > 
> > I have to still re-spin my fs sysctl stuff, but will wait to do that
> > once Xiaoming bases his series on linux-next.
> 
> Yeah, totally. I don't technically have a sysctl tree (I've always just
> had akpm take stuff), so go for it. I'm just doing reviews. :)

Oh, I don't want a tree either, it was just that I can imagine these
series can easily create conflcits, so I wanted to avoid that before
passing them on to Andrew.

  Luis

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sysctl: const-ify ngroups_max
  2020-05-18 18:30       ` Luis Chamberlain
@ 2020-05-18 21:14         ` Kees Cook
  0 siblings, 0 replies; 6+ messages in thread
From: Kees Cook @ 2020-05-18 21:14 UTC (permalink / raw)
  To: Luis Chamberlain
  Cc: Xiaoming Ni, Andrew Morton, Stephen Kitt, Iurii Zaikin,
	linux-fsdevel, linux-kernel

On Mon, May 18, 2020 at 06:30:55PM +0000, Luis Chamberlain wrote:
> On Mon, May 18, 2020 at 11:17:47AM -0700, Kees Cook wrote:
> > On Mon, May 18, 2020 at 05:25:09PM +0000, Luis Chamberlain wrote:
> > > On Mon, May 18, 2020 at 09:08:22AM -0700, Kees Cook wrote:
> > > > On Mon, May 18, 2020 at 05:57:27PM +0200, Stephen Kitt wrote:
> > > > > 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>
> > > > 
> > > > Reviewed-by: Kees Cook <keescook@chromium.org>
> > > 
> > > Kees, since there is quite a bit of sysctl cleanup stuff going on and I
> > > have a fs sysctl kitchen cleanup, are you alright if I carry this in a
> > > tree and send this to Andrew once done? This would hopefully avoid
> > > merge conflicts between these patches.
> > > 
> > > I have to still re-spin my fs sysctl stuff, but will wait to do that
> > > once Xiaoming bases his series on linux-next.
> > 
> > Yeah, totally. I don't technically have a sysctl tree (I've always just
> > had akpm take stuff), so go for it. I'm just doing reviews. :)
> 
> Oh, I don't want a tree either, it was just that I can imagine these
> series can easily create conflcits, so I wanted to avoid that before
> passing them on to Andrew.

Yup, that's cool. I happily defer to you on these cleanups! :)

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-18 21:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-18 15:57 [PATCH] sysctl: const-ify ngroups_max Stephen Kitt
2020-05-18 16:08 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).