summaryrefslogtreecommitdiffstats
path: root/include/target/target_core_base.h
diff options
context:
space:
mode:
authorBart Van Assche2019-04-02 21:58:05 +0200
committerMartin K. Petersen2019-04-13 02:20:05 +0200
commit63f7479439c95bcd49b7dd4af809862c316c71a3 (patch)
treec7c5509ade07fa7f5a6a01ff1bb7e40bfdeecb70 /include/target/target_core_base.h
parentscsi: scsi_transport_fc: nvme: display FC-NVMe port roles (diff)
downloadkernel-qcow2-linux-63f7479439c95bcd49b7dd4af809862c316c71a3.tar.gz
kernel-qcow2-linux-63f7479439c95bcd49b7dd4af809862c316c71a3.tar.xz
kernel-qcow2-linux-63f7479439c95bcd49b7dd4af809862c316c71a3.zip
scsi: target/core: Fix a race condition in the LUN lookup code
The rcu_dereference(deve->se_lun) expression occurs twice in the LUN lookup functions. Since these expressions are not serialized against deve->se_lun assignments each of these expressions may yield a different result. Avoid that the wrong LUN pointer is stored in se_cmd by reading deve->se_lun only once. Cc: Mike Christie <mchristi@redhat.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Hannes Reinecke <hare@suse.com> Cc: Nicholas Bellinger <nab@linux-iscsi.org> Fixes: 29a05deebf6c ("target: Convert se_node_acl->device_list[] to RCU hlist") # v4.10 Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/target/target_core_base.h')
0 files changed, 0 insertions, 0 deletions