]> git.baikalelectronics.ru Git - kernel.git/commit
IB/core: Fix user mode post wr corruption
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Tue, 1 Dec 2015 15:13:51 +0000 (10:13 -0500)
committerDoug Ledford <dledford@redhat.com>
Mon, 7 Dec 2015 21:22:14 +0000 (16:22 -0500)
commit4b7240503641a05f048593c8d0cbd93698018941
treebab111790d5f179664d016465780eaee8ae8fc9b
parent2b261bfd46891177e872f633509b604132c14d25
IB/core: Fix user mode post wr corruption

Commit 80e0c7022da2 ("IB: split struct ib_send_wr")
introduced a regression for HCAs whose user mode post
sends go through ib_uverbs_post_send().

The code didn't account for the fact that the first sge is
offset by an operation dependent length.  The allocation did,
but the pointer to the destination sge list is computed without
that knowledge.  The sge list copy_from_user() then corrupts
fields in the work request

Store the operation dependent length in a local variable and
compute the sge list copy_from_user() destination using that length.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/uverbs_cmd.c