cifs: Allocate memory for all iovs in smb2_ioctl
authorLong Li <longli@microsoft.com>
Wed, 15 May 2019 21:09:05 +0000 (14:09 -0700)
committerSteve French <stfrench@microsoft.com>
Thu, 16 May 2019 03:27:53 +0000 (22:27 -0500)
commit2c87d6a94d162e68ca393cb87719dae8737f55c0
treecd3f5b7d487cfcb182434229a8a0a12af740a03d
parent3b249115719ba2cb56d3f92ee7492e033059d3f3
cifs: Allocate memory for all iovs in smb2_ioctl

An IOCTL uses up to 2 iovs. The 1st iov is the command itself, the 2nd iov is
optional data for that command. The 1st iov is always allocated on the heap
but the 2nd iov may point to a variable on the stack. This will trigger an
error when passing the 2nd iov for RDMA I/O.

Fix this by allocating a buffer for the 2nd iov.

Signed-off-by: Long Li <longli@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Reviewed-by: Ronnie sahlberg <lsahlber@redhat.com>
fs/cifs/smb2pdu.c