Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/srp: Use pd->local_dma_lkey

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>

authored by

Jason Gunthorpe and committed by
Doug Ledford
e6bf5f48 34efc7df

+1 -1
+1 -1
drivers/infiniband/ulp/srp/ib_srp.c
··· 3154 3154 target->io_class = SRP_REV16A_IB_IO_CLASS; 3155 3155 target->scsi_host = target_host; 3156 3156 target->srp_host = host; 3157 - target->lkey = host->srp_dev->mr->lkey; 3157 + target->lkey = host->srp_dev->pd->local_dma_lkey; 3158 3158 target->rkey = host->srp_dev->mr->rkey; 3159 3159 target->cmd_sg_cnt = cmd_sg_entries; 3160 3160 target->sg_tablesize = indirect_sg_entries ? : cmd_sg_entries;