All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] docs: sysctl/kernel: document ngroups_max
@ 2020-05-15 16:02 Stephen Kitt
  2020-05-15 16:07 ` Kees Cook
  2020-05-15 17:24 ` Jonathan Corbet
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Kitt @ 2020-05-15 16:02 UTC (permalink / raw)
  To: Jonathan Corbet, Luis Chamberlain, Kees Cook, Iurii Zaikin,
	linux-doc, linux-fsdevel
  Cc: linux-kernel, Stephen Kitt

This is a read-only export of NGROUPS_MAX, so this patch also changes
the declarations in kernel/sysctl.c to const.

Signed-off-by: Stephen Kitt <steve@sk2.org>
---
 Documentation/admin-guide/sysctl/kernel.rst | 9 +++++++++
 kernel/sysctl.c                             | 4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
index 0d427fd10941..5f12ee07665c 100644
--- a/Documentation/admin-guide/sysctl/kernel.rst
+++ b/Documentation/admin-guide/sysctl/kernel.rst
@@ -459,6 +459,15 @@ Notes:
      successful IPC object allocation. If an IPC object allocation syscall
      fails, it is undefined if the value remains unmodified or is reset to -1.
 
+
+ngroups_max
+===========
+
+Maximum number of supplementary groups, _i.e._ the maximum size which
+``setgroups`` will accept. Exports ``NGROUPS_MAX`` from the kernel.
+
+
+
 nmi_watchdog
 ============
 
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 8a176d8727a3..2ba9f449d273 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -146,7 +146,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;
 
 /*
@@ -883,7 +883,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: 1ae7efb388540adc1653a51a3bc3b2c9cef5ec1a
-- 
2.20.1


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

* Re: [PATCH] docs: sysctl/kernel: document ngroups_max
  2020-05-15 16:02 [PATCH] docs: sysctl/kernel: document ngroups_max Stephen Kitt
@ 2020-05-15 16:07 ` Kees Cook
  2020-05-15 17:24 ` Jonathan Corbet
  1 sibling, 0 replies; 3+ messages in thread
From: Kees Cook @ 2020-05-15 16:07 UTC (permalink / raw)
  To: Stephen Kitt
  Cc: Jonathan Corbet, Luis Chamberlain, Iurii Zaikin, linux-doc,
	linux-fsdevel, linux-kernel

On Fri, May 15, 2020 at 06:02:22PM +0200, Stephen Kitt wrote:
> This is a read-only export of NGROUPS_MAX, so this patch also changes
> the declarations in kernel/sysctl.c to const.
> 
> Signed-off-by: Stephen Kitt <steve@sk2.org>

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

-- 
Kees Cook

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

* Re: [PATCH] docs: sysctl/kernel: document ngroups_max
  2020-05-15 16:02 [PATCH] docs: sysctl/kernel: document ngroups_max Stephen Kitt
  2020-05-15 16:07 ` Kees Cook
@ 2020-05-15 17:24 ` Jonathan Corbet
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Corbet @ 2020-05-15 17:24 UTC (permalink / raw)
  To: Stephen Kitt
  Cc: Luis Chamberlain, Kees Cook, Iurii Zaikin, linux-doc,
	linux-fsdevel, linux-kernel

On Fri, 15 May 2020 18:02:22 +0200
Stephen Kitt <steve@sk2.org> wrote:

> This is a read-only export of NGROUPS_MAX, so this patch also changes
> the declarations in kernel/sysctl.c to const.
> 
> Signed-off-by: Stephen Kitt <steve@sk2.org>
> ---
>  Documentation/admin-guide/sysctl/kernel.rst | 9 +++++++++
>  kernel/sysctl.c                             | 4 ++--
>  2 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
> index 0d427fd10941..5f12ee07665c 100644
> --- a/Documentation/admin-guide/sysctl/kernel.rst
> +++ b/Documentation/admin-guide/sysctl/kernel.rst
> @@ -459,6 +459,15 @@ Notes:
>       successful IPC object allocation. If an IPC object allocation syscall
>       fails, it is undefined if the value remains unmodified or is reset to -1.
>  
> +
> +ngroups_max
> +===========
> +
> +Maximum number of supplementary groups, _i.e._ the maximum size which
> +``setgroups`` will accept. Exports ``NGROUPS_MAX`` from the kernel.

Applied, thanks.

jon

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

end of thread, other threads:[~2020-05-15 17:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15 16:02 [PATCH] docs: sysctl/kernel: document ngroups_max Stephen Kitt
2020-05-15 16:07 ` Kees Cook
2020-05-15 17:24 ` Jonathan Corbet

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.