Skip to content

Commit 0abecc5

Browse files
scsi: target: iscsi: Fix timeout on deleted connection
JIRA: https://issues.redhat.com/browse/RHEL-111938 NOPIN response timer may expire on a deleted connection and crash with such logs: Did not receive response to NOPIN on CID: 0, failing connection for I_T Nexus (null),i,0x00023d000125,iqn.2017-01.com.iscsi.target,t,0x3d BUG: Kernel NULL pointer dereference on read at 0x00000000 NIP strlcpy+0x8/0xb0 LR iscsit_fill_cxn_timeout_err_stats+0x5c/0xc0 [iscsi_target_mod] Call Trace: iscsit_handle_nopin_response_timeout+0xfc/0x120 [iscsi_target_mod] call_timer_fn+0x58/0x1f0 run_timer_softirq+0x740/0x860 __do_softirq+0x16c/0x420 irq_exit+0x188/0x1c0 timer_interrupt+0x184/0x410 That is because nopin response timer may be re-started on nopin timer expiration. Stop nopin timer before stopping the nopin response timer to be sure that no one of them will be re-started. Signed-off-by: Dmitry Bogdanov <d.bogdanov@yadro.com> Link: https://lore.kernel.org/r/20241224101757.32300-1-d.bogdanov@yadro.com Reviewed-by: Maurizio Lombardi <mlombard@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> (cherry picked from commit 7f533cc) Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
1 parent cf0149c commit 0abecc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/target/iscsi/iscsi_target.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4317,8 +4317,8 @@ int iscsit_close_connection(
43174317
spin_unlock(&iscsit_global->ts_bitmap_lock);
43184318

43194319
iscsit_stop_timers_for_cmds(conn);
4320-
iscsit_stop_nopin_response_timer(conn);
43214320
iscsit_stop_nopin_timer(conn);
4321+
iscsit_stop_nopin_response_timer(conn);
43224322

43234323
if (conn->conn_transport->iscsit_wait_conn)
43244324
conn->conn_transport->iscsit_wait_conn(conn);

0 commit comments

Comments
 (0)