Message ID | 1437608083-22898-9-git-send-email-jgunthorpe@obsidianresearch.com (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show |
On 7/23/2015 2:34 AM, Jason Gunthorpe wrote: > Replace all leys with pd->local_dma_lkey. This driver does not support > iWarp, so this is safe. > > The insecure use of ib_get_dma_mr is thus isolated to an rkey, and will > have to be fixed separately. > > Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Looks good. Reviewed-by: Sagi Grimberg <sagig@mellanox.com> -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 267dc4f75502..fb9fed0fac28 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -3149,7 +3149,7 @@ static ssize_t srp_create_target(struct device *dev, target->io_class = SRP_REV16A_IB_IO_CLASS; target->scsi_host = target_host; target->srp_host = host; - target->lkey = host->srp_dev->mr->lkey; + target->lkey = host->srp_dev->pd->local_dma_lkey; target->rkey = host->srp_dev->mr->rkey; target->cmd_sg_cnt = cmd_sg_entries; target->sg_tablesize = indirect_sg_entries ? : cmd_sg_entries;
Replace all leys with pd->local_dma_lkey. This driver does not support iWarp, so this is safe. The insecure use of ib_get_dma_mr is thus isolated to an rkey, and will have to be fixed separately. Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> --- drivers/infiniband/ulp/srp/ib_srp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)