diff options
| author | Shyam Prasad N <sprasad@microsoft.com> | 2024-10-30 06:45:50 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-05 14:03:08 +0100 |
| commit | 0e4145774c016530bf99afb3675a1a0593c35642 (patch) | |
| tree | d4ab9e49d7987176964e71b6d311f71212f5ea6b /scripts/patch-kernel | |
| parent | e70c21daad17efa68b53c5160242d15959d92b25 (diff) | |
| download | linux-0e4145774c016530bf99afb3675a1a0593c35642.tar.gz linux-0e4145774c016530bf99afb3675a1a0593c35642.tar.bz2 linux-0e4145774c016530bf99afb3675a1a0593c35642.zip | |
cifs: during remount, make sure passwords are in sync
[ Upstream commit 0f0e357902957fba28ed31bde0d6921c6bd1485d ]
This fixes scenarios where remount can overwrite the only currently
working password, breaking reconnect.
We recently introduced a password2 field in both ses and ctx structs.
This was done so as to allow the client to rotate passwords for a mount
without any downtime. However, when the client transparently handles
password rotation, it can swap the values of the two password fields
in the ses struct, but not in smb3_fs_context struct that hangs off
cifs_sb. This can lead to a situation where a remount unintentionally
overwrites a working password in the ses struct.
In order to fix this, we first get the passwords in ctx struct
in-sync with ses struct, before replacing them with what the passwords
that could be passed as a part of remount.
Also, in order to avoid race condition between smb2_reconnect and
smb3_reconfigure, we make sure to lock session_mutex before changing
password and password2 fields of the ses structure.
Fixes: 35f834265e0d ("smb3: fix broken reconnect when password changing on the server by allowing password rotation")
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Meetakshi Setiya <msetiya@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'scripts/patch-kernel')
0 files changed, 0 insertions, 0 deletions
