smb3: Avoid Mid pending list corruption
authorRohith Surabattula <rohiths@microsoft.com>
Thu, 29 Oct 2020 05:03:10 +0000 (05:03 +0000)
committerSteve French <stfrench@microsoft.com>
Mon, 16 Nov 2020 05:05:33 +0000 (23:05 -0600)
commitac873aa3dc21707c47db5db6608b38981c731afe
treef579f182b091a8ab3f9c5164aa80af2180aeb6a2
parentde9ac0a6e9efdffc8cde18781f48fb56ca4157b7
smb3: Avoid Mid pending list corruption

When reconnect happens Mid queue can be corrupted when both
demultiplex and offload thread try to dequeue the MID from the
pending list.

These patches address a problem found during decryption offload:
         CIFS: VFS: trying to dequeue a deleted mid
that could cause a refcount use after free:
         Workqueue: smb3decryptd smb2_decrypt_offload [cifs]

Signed-off-by: Rohith Surabattula <rohiths@microsoft.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
CC: Stable <stable@vger.kernel.org> #5.4+
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2ops.c