Skip to contentSkip to conversation

scsi: iscsi: Fix set_param handling

PATCH Applied Mike Christie 4 participants 4 messages Oct 10, 2021 – Oct 12, 2021

Subsystems (2)
lore
Share & tools
lore

Mike Christie

author maintainer
#0 lore raw

PATCH 1/1 scsi: iscsi: Fix set_param handling

In:

commit 9e67600ed6b8 ("scsi: iscsi: Fix race condition between login and sync thread")

we meant to add a check where before we call set_param we make sure the iscsi_cls_connection is bound. The problem is that between versions 4 and 5 of the patch the deletion of the unchecked set_param call was dropped so we ended up with 2 calls. As a result we can still hit a crash where we access the unbound connection on the first call.

This patch removes that first call.

Fixes 9e67600ed6b8 ("scsi: iscsi: Fix race condition between login and

sync thread")

---
 drivers/scsi/scsi_transport_iscsi.c | 2 --
 1 file changed, 2 deletions(-)
drivers/scsi/scsi_transport_iscsi.c +0 -2
index 922e4c7bd88e..78343d3f9385 100644
@@ -2930,8 +2930,6 @@ iscsi_set_param(struct iscsi_transport *transport, struct iscsi_uevent *ev)
 			session->recovery_tmo = value;
 		break;
 	default:
-		err = transport->set_param(conn, ev->u.set_param.param,
-					   data, ev->u.set_param.len);
 		if ((conn->state == ISCSI_CONN_BOUND) ||
 			(conn->state == ISCSI_CONN_UP)) {
 			err = transport->set_param(conn, ev->u.set_param.param,
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 27 lines · Mike Christie

In:

commit 9e67600ed6b8 ("scsi: iscsi: Fix race condition between login and sync thread")

we meant to add a check where before we call set_param we make sure the iscsi_cls_connection is bound. The problem is that between versions 4 and 5 of the patch the deletion of the unchecked set_param call was dropped so we ended up with 2 calls. As a result we can still hit a crash where we access the unbound connection on the first call.

This patch removes that first call.

Fixes 9e67600ed6b8 ("scsi: iscsi: Fix race condition between login and

sync thread")

---
 drivers/scsi/scsi_transport_iscsi.c | 2 --
 1 file changed, 2 deletions(-)
drivers/scsi/scsi_transport_iscsi.c +0 -0
index 922e4c7bd88e..78343d3f9385 100644

drivers/scsi/scsi_transport_iscsi.c iscsi_set_param(struct iscsi_transport *transport, struct iscsi_uevent *ev) · line 2935

Quoted 8 lines
drivers/scsi/scsi_transport_iscsi.c +0 -2
@@ -2930,8 +2930,6 @@ iscsi_set_param(struct iscsi_transport *transport, struct iscsi_uevent *ev)
 			session->recovery_tmo = value;
 		break;
 	default:
-		err = transport->set_param(conn, ev->u.set_param.param,
-					   data, ev->u.set_param.len);
 		if ((conn->state == ISCSI_CONN_BOUND) ||
 			(conn->state == ISCSI_CONN_UP)) {
 			err = transport->set_param(conn, ev->u.set_param.param,
Reviewed-by
#2 lore raw
Quoted 23 lines · Lee Duncan <[email protected]> 于2021年10月11日周一 上午9:12写道:
Quoted 21 lines · Mike Christie

In:

commit 9e67600ed6b8 ("scsi: iscsi: Fix race condition between login and sync thread")

we meant to add a check where before we call set_param we make sure the iscsi_cls_connection is bound. The problem is that between versions 4 and 5 of the patch the deletion of the unchecked set_param call was dropped so we ended up with 2 calls. As a result we can still hit a crash where we access the unbound connection on the first call.

This patch removes that first call.

Fixes 9e67600ed6b8 ("scsi: iscsi: Fix race condition between login and

sync thread")

---
 drivers/scsi/scsi_transport_iscsi.c | 2 --
 1 file changed, 2 deletions(-)
Quoted 17 lines
Quoted 6 lines
drivers/scsi/scsi_transport_iscsi.c +0 -0
index 922e4c7bd88e..78343d3f9385 100644

drivers/scsi/scsi_transport_iscsi.c iscsi_set_param(struct iscsi_transport *transport, struct iscsi_uevent *ev) · line 2935

Quoted 8 lines
drivers/scsi/scsi_transport_iscsi.c +0 -2
@@ -2930,8 +2930,6 @@ iscsi_set_param(struct iscsi_transport *transport, struct iscsi_uevent *ev)
                      session->recovery_tmo = value;
              break;
      default:
-             err = transport->set_param(conn, ev->u.set_param.param,
-                                        data, ev->u.set_param.len);
              if ((conn->state == ISCSI_CONN_BOUND) ||
                      (conn->state == ISCSI_CONN_UP)) {
                      err = transport->set_param(conn, ev->u.set_param.param,
#3 lore raw
In reply to Mike Christie
Quoted 5 lines · Mike Christie

In:

commit 9e67600ed6b8 ("scsi: iscsi: Fix race condition between login and sync thread")

Quoted 7 lines

we meant to add a check where before we call set_param we make sure the iscsi_cls_connection is bound. The problem is that between versions 4 and 5 of the patch the deletion of the unchecked set_param call was dropped so we ended up with 2 calls. As a result we can still hit a crash where we access the unbound connection on the first call.

[...]

Applied to 5.15/scsi-fixes, thanks!

[1/1] scsi: iscsi: Fix set_param handling

      https://git.kernel.org/mkp/scsi/c/187a580c9e78
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering