[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZktQZi5iCwxcU0qs@tycho.pizza>
Date: Mon, 20 May 2024 07:30:14 -0600
From: Tycho Andersen <tycho@...ho.pizza>
To: Jonathan Calmels <jcalmels@...0.net>
Cc: brauner@...nel.org, ebiederm@...ssion.com,
Luis Chamberlain <mcgrof@...nel.org>,
Kees Cook <keescook@...omium.org>,
Joel Granados <j.granados@...sung.com>,
Serge Hallyn <serge@...lyn.com>, Paul Moore <paul@...l-moore.com>,
James Morris <jmorris@...ei.org>,
David Howells <dhowells@...hat.com>,
Jarkko Sakkinen <jarkko@...nel.org>, containers@...ts.linux.dev,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-security-module@...r.kernel.org, keyrings@...r.kernel.org
Subject: Re: [PATCH 3/3] capabilities: add cap userns sysctl mask
Hi Jonathan,
On Thu, May 16, 2024 at 02:22:05AM -0700, Jonathan Calmels wrote:
> +int proc_cap_userns_handler(struct ctl_table *table, int write,
> + void *buffer, size_t *lenp, loff_t *ppos)
> +{
there is an ongoing effort (started at [0]) to constify the first arg
here, since you're not supposed to write to it. Your usage looks
correct to me, so I think all it needs is a literal "const" here.
[0]: https://lore.kernel.org/lkml/20240423-sysctl-const-handler-v3-0-e0beccb836e2@weissschuh.net/
> + struct ctl_table t;
> + unsigned long mask_array[2];
> + kernel_cap_t new_mask, *mask;
> + int err;
> +
> + if (write && (!capable(CAP_SETPCAP) ||
> + !capable(CAP_SYS_ADMIN)))
> + return -EPERM;
..why CAP_SYS_ADMIN? You mention it in the changelog, but don't
explain why.
Tycho
Powered by blists - more mailing lists