Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Sasha Levin <sashal@kernel.org>
Cc: stable@vger.kernel.org, Paulo Alcantara <pc@manguebit.org>,
	Arthur Lesuisse <arthur.lesuisse@ulb.be>,
	Namjae Jeon <linkinjeon@kernel.org>,
	Ronnie Sahlberg <ronniesahlberg@gmail.com>,
	Shyam Prasad N <sprasad@microsoft.com>,
	Tom Talpey <tom@talpey.com>, Bharath SM <bharathsm@microsoft.com>
Subject: Re: [PATCH 6.18.y 2/2] smb: client: fix uid/gid override in getattr with posix extensions
Date: Thu, 17 Sep 2026 11:11:58 +0100	[thread overview]
Message-ID: <2026091754-fading-earmuff-40c4@gregkh> (raw)
In-Reply-To: <20260917042021.6589-2-sashal@kernel.org>

On Thu, Sep 17, 2026 at 12:20:21AM -0400, Sasha Levin wrote:
> From: Paulo Alcantara <pc@manguebit.org>
> 
> [ Upstream commit cf4d35896621b7298eef51b7a465e5c0cb22f670 ]
> 
> When mounting with 'multiuser,posix' options, cifs_getattr() overrides
> the server-provided uid/gid with the current process's fsuid/fsgid.
> This is because the condition only checks for unix extensions
> (tcon->unix_ext) but not posix extensions (tcon->posix_extensions).
> 
> With SMB3 POSIX extensions, the server provides real uid/gid values
> just like with unix extensions, so they should be preserved rather
> than replaced with the caller's credentials.
> 
> Add a tcon->posix_extensions check to the condition so that uid/gid
> from the server are properly reported in stat results.
> 
> Reported-by: Arthur Lesuisse <arthur.lesuisse@ulb.be>
> Closes: https://lore.kernel.org/r/DB9P190MB2012266F6B8DECBE5D26A1798DB52@DB9P190MB2012.EURP190.PROD.OUTLOOK.COM
> Suggested-by: Arthur Lesuisse <arthur.lesuisse@ulb.be>
> Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
> Signed-off-by: Paulo Alcantara <pc@manguebit.org>
> Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
> Cc: Shyam Prasad N <sprasad@microsoft.com>
> Cc: Tom Talpey <tom@talpey.com>
> Cc: Bharath SM <bharathsm@microsoft.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
>  fs/smb/client/inode.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c
> index e3858ab001695..b547466b1de90 100644
> --- a/fs/smb/client/inode.c
> +++ b/fs/smb/client/inode.c
> @@ -2972,14 +2972,14 @@ int cifs_getattr(struct mnt_idmap *idmap, const struct path *path,
>  		stat->attributes |= STATX_ATTR_ENCRYPTED;
>  
>  	/*
> -	 * If on a multiuser mount without unix extensions or cifsacl being
> -	 * enabled, and the admin hasn't overridden them, set the ownership
> -	 * to the fsuid/fsgid of the current process.
> +	 * If on a multiuser mount without unix extensions, posix extensions
> +	 * or cifsacl being enabled, and the admin hasn't overridden them,
> +	 * set the ownership to the fsuid/fsgid of the current process.
>  	 */
>  	sbflags = cifs_sb_flags(cifs_sb);
>  	if ((sbflags & CIFS_MOUNT_MULTIUSER) &&
>  	    !(sbflags & CIFS_MOUNT_CIFS_ACL) &&
> -	    !tcon->unix_ext) {
> +	    !tcon->unix_ext && !tcon->posix_extensions) {
>  		if (!(sbflags & CIFS_MOUNT_OVERR_UID))
>  			stat->uid = current_fsuid();
>  		if (!(sbflags & CIFS_MOUNT_OVERR_GID))
> -- 
> 2.53.0
> 
> 

Does not apply :(

      reply	other threads:[~2026-09-17 10:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16 16:42 FAILED: patch "[PATCH] smb: client: fix uid/gid override in getattr with posix" failed to apply to 6.18-stable tree gregkh
2026-09-17  4:20 ` [PATCH 6.18.y 1/2] smb: client: use atomic_t for mnt_cifs_flags Sasha Levin
2026-09-17  4:20   ` [PATCH 6.18.y 2/2] smb: client: fix uid/gid override in getattr with posix extensions Sasha Levin
2026-09-17 10:11     ` Greg KH [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=2026091754-fading-earmuff-40c4@gregkh \
    --to=greg@kroah.com \
    --cc=arthur.lesuisse@ulb.be \
    --cc=bharathsm@microsoft.com \
    --cc=linkinjeon@kernel.org \
    --cc=pc@manguebit.org \
    --cc=ronniesahlberg@gmail.com \
    --cc=sashal@kernel.org \
    --cc=sprasad@microsoft.com \
    --cc=stable@vger.kernel.org \
    --cc=tom@talpey.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