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 3A31320F07C; Mon, 2 Jun 2025 14:51:41 +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=1748875901; cv=none; b=nW3eitD+J3Lggyq9nCiPVp/UZMYFaaNjxwCBp8PB1ZGw+uMpmVxNk8uX8u7DDiZNC5UDak/2b3QkamQ+6rwyjmcXDq350uDNGWpH1Fgj3RpRVZ5b2zim2q2E63anA/VF3NH3jrPX3OvQDuUElwD2NLb7iXaGLjXzA/t2aLEuprw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748875901; c=relaxed/simple; bh=GNp0JPbwMxaz7x0OONzku5J1G4d/o7bhx7+7rAAZHn8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R/gt4SNpn318ekYmS9PAQMHcaxqIlReL8DJyOHTxKgrYEiURUAEkBI5QxY96E8sXqbWuJ1TDWNg8feo4dGCXHXpOddvZ4y94skerNPtek3d8o3TE1j82U5JCPWgfMtOseBOtKCcEy+o0Blcu2khaAqU2BDrJMWg6V6rozR4E0Jg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=pEuLYQgb; 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="pEuLYQgb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7044C4CEEB; Mon, 2 Jun 2025 14:51:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748875901; bh=GNp0JPbwMxaz7x0OONzku5J1G4d/o7bhx7+7rAAZHn8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pEuLYQgbHu8QIoX4XLre9dYcDv5J3DkIVyYzgO6gQUOiuk4B0HSmhlzTVetDEdY3z DUEacv1pJCLpadhJ2qbGlIxjO5/W2Tuc9FQ5y/2GRsqd2f0GW/YbfOC9JEuTwDEf3L 8XC2g+MNmc/G+u2vhCZQmdSzrZ9mhCFJw0JIodYY= 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.15 001/207] scsi: target: iscsi: Fix timeout on deleted connection Date: Mon, 2 Jun 2025 15:46:13 +0200 Message-ID: <20250602134258.830022963@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250602134258.769974467@linuxfoundation.org> References: <20250602134258.769974467@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.15-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 686a9e5918e21..b072718701329 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -4170,8 +4170,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