Skip to content
/ linux Public

Commit 1d731e5

Browse files
sprasad-microsoftSasha Levin
authored andcommitted
cifs: some missing initializations on replay
[ Upstream commit 14f66f4 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f73b365 commit 1d731e5

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

fs/smb/client/smb2ops.c

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

11881188
replay_again:
11891189
/* reinitialize for possible replay */
1190+
used_len = 0;
11901191
flags = CIFS_CP_CREATE_CLOSE_OP;
11911192
oplock = SMB2_OPLOCK_LEVEL_NONE;
11921193
server = cifs_pick_channel(ses);
@@ -1585,6 +1586,7 @@ smb2_ioctl_query_info(const unsigned int xid,
15851586

15861587
replay_again:
15871588
/* reinitialize for possible replay */
1589+
buffer = NULL;
15881590
flags = CIFS_CP_CREATE_CLOSE_OP;
15891591
oplock = SMB2_OPLOCK_LEVEL_NONE;
15901592
server = cifs_pick_channel(ses);

fs/smb/client/smb2pdu.c

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

28572857
replay_again:
28582858
/* reinitialize for possible replay */
2859+
pc_buf = NULL;
28592860
flags = 0;
28602861
n_iov = 2;
28612862
server = cifs_pick_channel(ses);

0 commit comments

Comments
 (0)