smb3: Handle error case during offload read path
authorRohith Surabattula <rohiths@microsoft.com>
Thu, 29 Oct 2020 06:07:56 +0000 (06:07 +0000)
committerSteve French <stfrench@microsoft.com>
Mon, 16 Nov 2020 05:05:33 +0000 (23:05 -0600)
commit1254100030b3377e8302f9c75090ab191d73ee7c
tree3bfdd0d58a3026cdb5d39d37db087b1d759f85f7
parentac873aa3dc21707c47db5db6608b38981c731afe
smb3: Handle error case during offload read path

Mid callback needs to be called only when valid data is
read into pages.

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