RDMA/qedr: Prevent memory overrun in verbs' user responses
authorAmrani, Ram <Ram.Amrani@cavium.com>
Mon, 26 Jun 2017 16:05:04 +0000 (19:05 +0300)
committerDoug Ledford <dledford@redhat.com>
Thu, 20 Jul 2017 15:20:50 +0000 (11:20 -0400)
commitc75d3ec8c0ee469de79ae83c1a827d753603e49f
tree49ac00312ed0d4af72a8254e95baa98450f3c089
parent720336c42e41a917002fcae3aa14e30f5022bbb7
RDMA/qedr: Prevent memory overrun in verbs' user responses

Wrap ib_copy_to_udata with a function that ensures that the data
being copied over to user space isn't longer than the allowed.

Fixes: cecbcddf6461 ("qedr: Add support for QP verbs")
Fixes: a7efd7773e31 ("qedr: Add support for PD,PKEY and CQ verbs")
Fixes: ac1b36e55a51 ("qedr: Add support for user context verbs")
Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/qedr/verbs.c