]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
smb311 client: fix missing tcon check when mounting with linux/posix extensions
authorSteve French <stfrench@microsoft.com>
Sun, 6 Apr 2025 19:09:19 +0000 (14:09 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Apr 2025 08:18:10 +0000 (10:18 +0200)
commit b365b9d404b7376c60c91cd079218bfef11b7822 upstream.

When mounting the same share twice, once with the "linux" mount parameter
(or equivalently "posix") and then once without (or e.g. with "nolinux"),
we were incorrectly reusing the same tree connection for both mounts.
This meant that the first mount of the share on the client, would
cause subsequent mounts of that same share on the same client to
ignore that mount parm ("linux" vs. "nolinux") and incorrectly reuse
the same tcon.

Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/client/connect.c

index cc4cd7ec7224900fd0c409fb42a51ec3965f8b6a..41c703b9c91ca4b363e3344d71e8b001e7892c03 100644 (file)
@@ -2494,6 +2494,8 @@ static int match_tcon(struct cifs_tcon *tcon, struct smb3_fs_context *ctx)
                return 0;
        if (tcon->nodelete != ctx->nodelete)
                return 0;
+       if (tcon->posix_extensions != ctx->linux_ext)
+               return 0;
        return 1;
 }