aboutsummaryrefslogtreecommitdiffstats
path: root/include/target
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2012-12-05 02:43:57 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2012-12-05 03:11:36 -0500
commit0ff8754981261a80f4b77db2536dfea92c2d4539 (patch)
tree47f1e6c46a77542fabc39ec3003183a5847045cf /include/target
parent3e4f574857eebce60bb56d7524f3f9eaa2a126d0 (diff)
target: Add link_magic for fabric allow_link destination target_items
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> Cc: stable@vger.kernel.org Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/target')
-rw-r--r--include/target/target_core_base.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 645d90ac6097..1346ee04db5e 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -624,6 +624,8 @@ struct se_dev_stat_grps {
624}; 624};
625 625
626struct se_device { 626struct se_device {
627#define SE_DEV_LINK_MAGIC 0xfeeddeef
628 u32 dev_link_magic;
627 /* RELATIVE TARGET PORT IDENTIFER Counter */ 629 /* RELATIVE TARGET PORT IDENTIFER Counter */
628 u16 dev_rpti_counter; 630 u16 dev_rpti_counter;
629 /* Used for SAM Task Attribute ordering */ 631 /* Used for SAM Task Attribute ordering */
@@ -722,6 +724,8 @@ struct se_port_stat_grps {
722}; 724};
723 725
724struct se_lun { 726struct se_lun {
727#define SE_LUN_LINK_MAGIC 0xffff7771
728 u32 lun_link_magic;
725 /* See transport_lun_status_table */ 729 /* See transport_lun_status_table */
726 enum transport_lun_status_table lun_status; 730 enum transport_lun_status_table lun_status;
727 u32 lun_access; 731 u32 lun_access;