[SMB3] send channel sequence number in SMB3 requests after reconnects
authorSteve French <stfrench@microsoft.com>
Fri, 25 Aug 2023 04:29:18 +0000 (23:29 -0500)
committerSteve French <stfrench@microsoft.com>
Fri, 25 Aug 2023 04:37:06 +0000 (23:37 -0500)
commit09ee7a3bf866c0fa5ee1914d2c65958559eb5b4c
tree28032714614a3bbbe83a8b948d5def6164ad81cd
parentb6d44d42313baa45a81ce9b299aeee2ccf3d0ee1
[SMB3] send channel sequence number in SMB3 requests after reconnects

The ChannelSequence field in the SMB3 header is supposed to be
increased after reconnect to allow the server to distinguish
requests from before and after the reconnect.  We had always
been setting it to zero.  There are cases where incrementing
ChannelSequence on requests after network reconnects can reduce
the chance of data corruptions.

See MS-SMB2 3.2.4.1 and 3.2.7.1

Signed-off-by: Steve French <stfrench@microsoft.com>
Cc: stable@vger.kernel.org # 5.16+
fs/smb/client/cifsglob.h
fs/smb/client/connect.c
fs/smb/client/smb2ops.c
fs/smb/client/smb2pdu.c
fs/smb/common/smb2pdu.h