IB/hfi1: Split copy_to_user data copy for better security
authorMichael J. Ruhl <michael.j.ruhl@intel.com>
Mon, 24 Jul 2017 14:46:42 +0000 (07:46 -0700)
committerDoug Ledford <dledford@redhat.com>
Mon, 31 Jul 2017 19:18:37 +0000 (15:18 -0400)
commitf13a6e5e2e0192737c3bdbdb16c5cc0181cc86e5
treed2d4316f48919763916db9e769f58d8a35c10ad2
parent5e2d6764a729bf8d43894b0368b0ae11a19485c0
IB/hfi1: Split copy_to_user data copy for better security

A copy_to_user() call assumes that two members of a data structure
are sequential.  Since this may not always be true, separate the copies
to ensure a safe copy.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/file_ops.c