IB/srp: Use pd->local_dma_lkey
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Thu, 30 Jul 2015 23:22:22 +0000 (17:22 -0600)
committerDoug Ledford <dledford@redhat.com>
Sun, 30 Aug 2015 22:12:35 +0000 (18:12 -0400)
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>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/ulp/srp/ib_srp.c

index c9c4f647b170117c13bedeb9c7478d6c76a9d1f8..b890367d26ed286e09afab2ca49048b6a019863f 100644 (file)
@@ -3154,7 +3154,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;