]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
cifs: some missing initializations on replay
authorShyam Prasad N <sprasad@microsoft.com>
Sat, 14 Feb 2026 10:29:13 +0000 (15:59 +0530)
committerSteve French <stfrench@microsoft.com>
Mon, 16 Feb 2026 00:32:39 +0000 (18:32 -0600)
In several places in the code, we have a label to signify
the start of the code where a request can be replayed if
necessary. However, some of these places were missing the
necessary reinitializations of certain local variables
before replay.

This change makes sure that these variables get initialized
after the label.

Cc: stable@vger.kernel.org
Reported-by: Yuchan Nam <entropy1110@gmail.com>
Tested-by: Yuchan Nam <entropy1110@gmail.com>
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smb2ops.c
fs/smb/client/smb2pdu.c

index 61c521712f86343136412c8eb4ca780ba8aaee3b..7370d7a18cd0c01b82332f2021ee8beadb50e72a 100644 (file)
@@ -1185,6 +1185,7 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
 
 replay_again:
        /* reinitialize for possible replay */
+       used_len = 0;
        flags = CIFS_CP_CREATE_CLOSE_OP;
        oplock = SMB2_OPLOCK_LEVEL_NONE;
        server = cifs_pick_channel(ses);
@@ -1588,6 +1589,7 @@ smb2_ioctl_query_info(const unsigned int xid,
 
 replay_again:
        /* reinitialize for possible replay */
+       buffer = NULL;
        flags = CIFS_CP_CREATE_CLOSE_OP;
        oplock = SMB2_OPLOCK_LEVEL_NONE;
        server = cifs_pick_channel(ses);
index 4602b4dfe8322e65aa36dfc8f7e05e3d5ff4027d..7f3edf42b9c3f86ec6fc54f2a5ec118edc091967 100644 (file)
@@ -2908,6 +2908,7 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
 
 replay_again:
        /* reinitialize for possible replay */
+       pc_buf = NULL;
        flags = 0;
        n_iov = 2;
        server = cifs_pick_channel(ses);