Skip to content

Commit 03d9a9f

Browse files
Roberto Bergantinos Corpassmfrench
authored andcommitted
CIFS: avoid using MID 0xFFFF
According to MS-CIFS specification MID 0xFFFF should not be used by the CIFS client, but we actually do. Besides, this has proven to cause races leading to oops between SendReceive2/cifs_demultiplex_thread. On SMB1, MID is a 2 byte value easy to reach in CurrentMid which may conflict with an oplock break notification request coming from server Signed-off-by: Roberto Bergantinos Corpas <[email protected]> Reviewed-by: Ronnie Sahlberg <[email protected]> Reviewed-by: Aurelien Aptel <[email protected]> Signed-off-by: Steve French <[email protected]> CC: Stable <[email protected]>
1 parent 553292a commit 03d9a9f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/cifs/smb1ops.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ cifs_get_next_mid(struct TCP_Server_Info *server)
171171
/* we do not want to loop forever */
172172
last_mid = cur_mid;
173173
cur_mid++;
174+
/* avoid 0xFFFF MID */
175+
if (cur_mid == 0xffff)
176+
cur_mid++;
174177

175178
/*
176179
* This nested loop looks more expensive than it is.

0 commit comments

Comments
 (0)