Linux Security Modules development
 help / color / mirror / Atom feed
From: "Serge Hallyn (AMD)" <sergeh@kernel.org>
To: Adriano Cordova <adrianox@gmail.com>
Cc: Serge Hallyn <serge@hallyn.com>, Paul Moore <paul@paul-moore.com>,
	James Morris <jmorris@namei.org>,
	linux-security-module@vger.kernel.org
Subject: Re: [PATCH v2] security: commoncap: clarify CAP_FS_SET comment in cap_task_fix_setuid()
Date: Thu, 22 Oct 2026 10:21:12 -0500	[thread overview]
Message-ID: <atop6FRjWXw9Jc7W@shallyn-amd> (raw)
In-Reply-To: <20260921025209.1023530-1-adrianox@gmail.com>

On Sun, Sep 20, 2026 at 11:52:08PM -0300, Adriano Cordova wrote:
> CAP_FS_SET is exactly the set of capabilities that an fsuid of 0
> historically granted (see CAP_FS_MASK in include/linux/capability.h),
> so cap_task_fix_setuid() drops that set from the effective set when
> fsuid leaves 0.  Replace the stale FIXME with this explanation.
> 
> Signed-off-by: Adriano Cordova <adrianox@gmail.com>

Hi,

so I had this in the caps-next branch, and was getting ready to send
a PR...  and was not feeling could about the new text.  It's stating
the obvious.  Do you mind sending a new version that just drops the
FIXME an ddoesn't add the new text?

> ---
> v2: reword the comment to something more concise.
> 
>  security/commoncap.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/security/commoncap.c b/security/commoncap.c
> index 3399535808fe..1ba2ea2651fc 100644
> --- a/security/commoncap.c
> +++ b/security/commoncap.c
> @@ -1169,11 +1169,13 @@ int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags)
>  		break;
>  
>  	case LSM_SETID_FS:
> -		/* juggle the capabilities to follow FSUID changes, unless
> -		 * otherwise suppressed
> +		/* Juggle the capabilities to follow FSUID changes, unless
> +		 * otherwise suppressed.
>  		 *
> -		 * FIXME - is fsuser used for all CAP_FS_MASK capabilities?
> -		 *          if not, we might be a bit too harsh here.
> +		 * CAP_FS_SET is exactly the set of capabilities that an
> +		 * fsuid of 0 historically granted (see CAP_FS_MASK in
> +		 * <linux/capability.h>), so we drop that set when fsuid
> +		 * leaves 0.
>  		 */
>  		if (!issecure(SECURE_NO_SETUID_FIXUP)) {
>  			kuid_t root_uid = make_kuid(old->user_ns, 0);
> -- 
> 2.51.0
> 

      parent reply	other threads:[~2026-10-22 15:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-21  2:52 [PATCH v2] security: commoncap: clarify CAP_FS_SET comment in cap_task_fix_setuid() Adriano Cordova
2026-09-21  2:55 ` sashiko-bot
2026-09-22 17:02 ` Serge E. Hallyn
2026-10-22 15:21 ` Serge Hallyn (AMD) [this message]

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=atop6FRjWXw9Jc7W@shallyn-amd \
    --to=sergeh@kernel.org \
    --cc=adrianox@gmail.com \
    --cc=jmorris@namei.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=serge@hallyn.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox