From: Greg Kroah-Hartman Date: Fri, 1 Feb 2013 10:41:21 +0000 (+0100) Subject: 3.4-stable patches X-Git-Tag: v3.0.62~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=40b95fb114ca686b0588075dd2ffac10d95bba3c;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: target-fix-regression-with-dev_link_magic-in-target_fabric_port_link.patch --- diff --git a/queue-3.4/series b/queue-3.4/series index b3ea49a8f75..99bcd392947 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -30,3 +30,4 @@ x86-msr-add-capabilities-check.patch efi-x86-pass-a-proper-identity-mapping-in-efi_call_phys_prelog.patch x86-efi-set-runtime_version-to-the-efi-spec-revision.patch x86-sandy-bridge-sandy-bridge-workaround-depends-on-config_pci.patch +target-fix-regression-with-dev_link_magic-in-target_fabric_port_link.patch diff --git a/queue-3.4/target-fix-regression-with-dev_link_magic-in-target_fabric_port_link.patch b/queue-3.4/target-fix-regression-with-dev_link_magic-in-target_fabric_port_link.patch new file mode 100644 index 00000000000..856a6901e05 --- /dev/null +++ b/queue-3.4/target-fix-regression-with-dev_link_magic-in-target_fabric_port_link.patch @@ -0,0 +1,51 @@ +From caiqian@redhat.com Fri Feb 1 11:39:40 2013 +From: Nicholas Bellinger +Date: Thu, 24 Jan 2013 21:57:14 -0500 (EST) +Subject: target: fix regression with dev_link_magic in target_fabric_port_link +To: stable@vger.kernel.org +Cc: Nicholas Bellinger , Chris Boot +Message-ID: <1667210120.9168305.1359082634537.JavaMail.root@redhat.com> + +From: Nicholas Bellinger + +This is to fix a regression that only affect the stable (not for the mainline) +that the stable commit fdf9d86 was incorrectly placed dev->dev_link_magic check +before the *dev assignment in target_fabric_port_link() due to fuzzy automatically +context adjustment during the back-porting. + +Reported-by: Chris Boot +Signed-off-by: Nicholas Bellinger +Signed-off-by: CAI Qian +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/target/target_core_fabric_configfs.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +--- a/drivers/target/target_core_fabric_configfs.c ++++ b/drivers/target/target_core_fabric_configfs.c +@@ -752,12 +752,6 @@ static int target_fabric_port_link( + struct target_fabric_configfs *tf; + int ret; + +- if (dev->dev_link_magic != SE_DEV_LINK_MAGIC) { +- pr_err("Bad dev->dev_link_magic, not a valid se_dev_ci pointer:" +- " %p to struct se_device: %p\n", se_dev_ci, dev); +- return -EFAULT; +- } +- + tpg_ci = &lun_ci->ci_parent->ci_group->cg_item; + se_tpg = container_of(to_config_group(tpg_ci), + struct se_portal_group, tpg_group); +@@ -775,6 +769,11 @@ static int target_fabric_port_link( + ret = -ENODEV; + goto out; + } ++ if (dev->dev_link_magic != SE_DEV_LINK_MAGIC) { ++ pr_err("Bad dev->dev_link_magic, not a valid se_dev_ci pointer:" ++ " %p to struct se_device: %p\n", se_dev_ci, dev); ++ return -EFAULT; ++ } + + lun_p = core_dev_add_lun(se_tpg, dev->se_hba, dev, + lun->unpacked_lun);