summaryrefslogtreecommitdiff
path: root/drivers/target/target_core_xcopy.h
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@suse.de>2020-11-03 04:21:58 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-01-12 22:10:25 +0300
commitfff1180d24e68d697f98642d71444316036a81ff (patch)
treed98951bf7cc46bf651b68d5711f782904183bd13 /drivers/target/target_core_xcopy.h
parent1412cdde820467d212515798366c9cc242dc1c59 (diff)
downloadlinux-fff1180d24e68d697f98642d71444316036a81ff.tar.xz
scsi: target: Fix XCOPY NAA identifier lookup
commit 2896c93811e39d63a4d9b63ccf12a8fbc226e5e4 upstream. When attempting to match EXTENDED COPY CSCD descriptors with corresponding se_devices, target_xcopy_locate_se_dev_e4() currently iterates over LIO's global devices list which includes all configured backstores. This change ensures that only initiator-accessible backstores are considered during CSCD descriptor lookup, according to the session's se_node_acl LUN list. To avoid LUN removal race conditions, device pinning is changed from being configfs based to instead using the se_node_acl lun_ref. Reference: CVE-2020-28374 Fixes: cbf031f425fd ("target: Add support for EXTENDED_COPY copy offload emulation") Reviewed-by: Lee Duncan <lduncan@suse.com> Signed-off-by: David Disseldorp <ddiss@suse.de> Signed-off-by: Mike Christie <michael.christie@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/target/target_core_xcopy.h')
-rw-r--r--drivers/target/target_core_xcopy.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/target/target_core_xcopy.h b/drivers/target/target_core_xcopy.h
index 26ba4c3c9cff..974bc1e19ff2 100644
--- a/drivers/target/target_core_xcopy.h
+++ b/drivers/target/target_core_xcopy.h
@@ -29,6 +29,7 @@ struct xcopy_op {
struct se_device *dst_dev;
unsigned char dst_tid_wwn[XCOPY_NAA_IEEE_REGEX_LEN];
unsigned char local_dev_wwn[XCOPY_NAA_IEEE_REGEX_LEN];
+ struct percpu_ref *remote_lun_ref;
sector_t src_lba;
sector_t dst_lba;