]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
smb: client: Fix match_session bug preventing session reuse
authorHenrique Carvalho <henrique.carvalho@suse.com>
Tue, 11 Mar 2025 18:23:59 +0000 (15:23 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:31:53 +0000 (14:31 +0200)
commit9b7cabd248126628827c9468d8167da5630f6e47
treef6d6bc70c17136b3edb953049091ca2c061a772f
parentf435192e00bc4d5d4134356b93212670ec47fa8d
smb: client: Fix match_session bug preventing session reuse

commit 605b249ea96770ac4fac4b8510a99e0f8442be5e upstream.

Fix a bug in match_session() that can causes the session to not be
reused in some cases.

Reproduction steps:

mount.cifs //server/share /mnt/a -o credentials=creds
mount.cifs //server/share /mnt/b -o credentials=creds,sec=ntlmssp
cat /proc/fs/cifs/DebugData | grep SessionId | wc -l

mount.cifs //server/share /mnt/b -o credentials=creds,sec=ntlmssp
mount.cifs //server/share /mnt/a -o credentials=creds
cat /proc/fs/cifs/DebugData | grep SessionId | wc -l

Cc: stable@vger.kernel.org
Reviewed-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/connect.c