Skip to content

Commit 14f66f4

Browse files
sprasad-microsoftsmfrench
authored andcommitted
cifs: some missing initializations on replay
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>
1 parent a5a50f1 commit 14f66f4

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

fs/smb/client/smb2ops.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,7 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
11851185

11861186
replay_again:
11871187
/* reinitialize for possible replay */
1188+
used_len = 0;
11881189
flags = CIFS_CP_CREATE_CLOSE_OP;
11891190
oplock = SMB2_OPLOCK_LEVEL_NONE;
11901191
server = cifs_pick_channel(ses);
@@ -1588,6 +1589,7 @@ smb2_ioctl_query_info(const unsigned int xid,
15881589

15891590
replay_again:
15901591
/* reinitialize for possible replay */
1592+
buffer = NULL;
15911593
flags = CIFS_CP_CREATE_CLOSE_OP;
15921594
oplock = SMB2_OPLOCK_LEVEL_NONE;
15931595
server = cifs_pick_channel(ses);

fs/smb/client/smb2pdu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2908,6 +2908,7 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
29082908

29092909
replay_again:
29102910
/* reinitialize for possible replay */
2911+
pc_buf = NULL;
29112912
flags = 0;
29122913
n_iov = 2;
29132914
server = cifs_pick_channel(ses);

0 commit comments

Comments
 (0)