lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 22 Jul 2015 15:08:17 -0700
From:	Spencer Baugh <sbaugh@...ern.com>
To:	"Nicholas A. Bellinger" <nab@...ux-iscsi.org>,
	linux-scsi@...r.kernel.org (open list:TARGET SUBSYSTEM),
	target-devel@...r.kernel.org (open list:TARGET SUBSYSTEM),
	linux-kernel@...r.kernel.org (open list)
Cc:	Joern Engel <joern@...estorage.com>,
	Spencer Baugh <Spencer.baugh@...estorage.com>,
	Roland Dreier <roland@...estorage.com>,
	Spencer Baugh <sbaugh@...ern.com>
Subject: [PATCH] target: respond to unknown initiators with sensible REPORT LUNS list length

From: Roland Dreier <roland@...estorage.com>

Solaris seems to go beserk if we respond to REPORT LUNS with a
LUN LIST LENGTH of 0.

Signed-off-by: Roland Dreier <roland@...estorage.com>
Signed-off-by: Spencer Baugh <sbaugh@...ern.com>
---
 drivers/target/target_core_spc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c
index 87d4adb..d8a32e5 100644
--- a/drivers/target/target_core_spc.c
+++ b/drivers/target/target_core_spc.c
@@ -1241,6 +1241,13 @@ sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd)
 	 * See SPC3 r07, page 159.
 	 */
 done:
+	/*
+	 * If no real LUNs are accessible, report an allocation length
+	 * of 1 LUN to account for virtual LUN 0.
+	 */
+	if (lun_count == 0)
+		lun_count = 1;
+
 	lun_count *= 8;
 	buf[0] = ((lun_count >> 24) & 0xff);
 	buf[1] = ((lun_count >> 16) & 0xff);
-- 
2.5.0.rc3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ