From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4FCB2153CB; Mon, 2 Jun 2025 14:43:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748875380; cv=none; b=Btv8uk1b+yISufEtd8F6GVO5GWH2K6JYYgO/Cs9BmdxN4iBkiUawSPHgrhmxyvTs5GVcb8ZLQbWiArgO5Qa1Wyx73N3oUviGBnINbnFODWBjGiChYMFG7wZRSSgwEn2/kvrBjV15YV+GvNveNK3eV0QTzDGcMX6wWXAYLwwXJTo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748875380; c=relaxed/simple; bh=n2mfovEamOTReBG/leyOsyNmrOi+CXSkAX+mDyKoDeM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GfrX7V1S4GUssxWSTdLrYHGshKGleZ6x0IXrOuV8aR5CwHULanlXLkqUUTe9498SqOmpIM06nLx34nTvuS+KjWmWLAzXgJ/VvwLUFailAIl5KubGdKKsAG67pvKtbrI4fOiRM6L2z+5slul8V2w0vPbwnD+Q3sefk4ZnCoNCssE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=d+4T+0yL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="d+4T+0yL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21E89C4CEEB; Mon, 2 Jun 2025 14:42:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748875380; bh=n2mfovEamOTReBG/leyOsyNmrOi+CXSkAX+mDyKoDeM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d+4T+0yLZ/zaNUKldpKrbO/6Iwfo1UyMLrxjY79Gn4u1x4W4lSUQ7W/yplMamU2+Q XOoOy1g7+Sdr6y4CMCfkMwC7XbID0rt4OxIvKvBP+9t+Y7dF8gDHmxuDLO2U1PB6zH b70vMS/jNhn9VrrLCzEp4MBnTuL41vCWcRCQvSd4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dmitry Bogdanov , Maurizio Lombardi , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.10 116/270] scsi: target: iscsi: Fix timeout on deleted connection Date: Mon, 2 Jun 2025 15:46:41 +0200 Message-ID: <20250602134311.970801244@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250602134307.195171844@linuxfoundation.org> References: <20250602134307.195171844@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dmitry Bogdanov [ Upstream commit 7f533cc5ee4c4436cee51dc58e81dfd9c3384418 ] 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 Link: https://lore.kernel.org/r/20241224101757.32300-1-d.bogdanov@yadro.com Reviewed-by: Maurizio Lombardi Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/target/iscsi/iscsi_target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 075e2a6fb474f..48fe53323f84c 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -4168,8 +4168,8 @@ int iscsit_close_connection( spin_unlock(&iscsit_global->ts_bitmap_lock); iscsit_stop_timers_for_cmds(conn); - iscsit_stop_nopin_response_timer(conn); iscsit_stop_nopin_timer(conn); + iscsit_stop_nopin_response_timer(conn); if (conn->conn_transport->iscsit_wait_conn) conn->conn_transport->iscsit_wait_conn(conn); -- 2.39.5