vfio: checking of validity of user vaddr in vfio_dma_rw
authorYan Zhao <yan.y.zhao@intel.com>
Wed, 8 Apr 2020 07:11:21 +0000 (03:11 -0400)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 20 Apr 2020 18:38:22 +0000 (12:38 -0600)
commit205323b8ceac57b0ac9d7dbc4d6fcdb18aa802ec
tree408a73957b316c64204997b53689f1c56d5b37f0
parentae83d0b416db002fe95601e7f97f64b59514d936
vfio: checking of validity of user vaddr in vfio_dma_rw

instead of calling __copy_to/from_user(), use copy_to_from_user() to
ensure vaddr range is a valid user address range before accessing them.

Fixes: 8d46c0cca5f4 ("vfio: introduce vfio_dma_rw to read/write a range of IOVAs")
Signed-off-by: Yan Zhao <yan.y.zhao@intel.com>
Reported-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/vfio_iommu_type1.c