summaryrefslogtreecommitdiff
path: root/drivers/target/target_core_device.c
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2012-12-04 23:43:57 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-21 11:45:24 -0800
commit92a7389317838f3338466df0c0e3d23ad33cb1f4 (patch)
tree6ccd124313aa8d7abbf16fd5aab09af8d80b8acb /drivers/target/target_core_device.c
parentced8dfbc6b44c7b14204a13ff95f22bdee52578f (diff)
target: Add link_magic for fabric allow_link destination target_items
commit 0ff8754981261a80f4b77db2536dfea92c2d4539 upstream. This patch adds [dev,lun]_link_magic value assignment + checks within generic target_fabric_port_link() and target_fabric_mappedlun_link() code to ensure destination config_item *target_item sent from configfs_symlink() -> config_item_operations->allow_link() is the underlying se_device->dev_group and se_lun->lun_group that we expect to symlink. Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> Signed-off-by: CAI Qian <caiqian@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/target/target_core_device.c')
-rw-r--r--drivers/target/target_core_device.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 4df8022fe3c..26c62f05975 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -1665,6 +1665,7 @@ int core_dev_setup_virtual_lun0(void)
ret = PTR_ERR(dev);
goto out;
}
+ dev->dev_link_magic = SE_DEV_LINK_MAGIC;
se_dev->se_dev_ptr = dev;
g_lun0_dev = dev;