]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit18856fe0addf61d635c62cc35170f0b0f7209fe3
treecd3f5b7d487cfcb182434229a8a0a12af740a03d
parent93c6488a2ea2a7bf8776da08088eeeea1eae10a0
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