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 4C77F27D766; Tue, 27 May 2025 17:18:19 +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=1748366299; cv=none; b=Vkg6lCKnMtSTRv2Z78WUtuW18vlGOfkjjZ5lrl5XSYe55G1ya0WhAoiSx13Jz2bhgdGRJSHk25j3BpiqehJprRgKXBju1+TlEpS4LtKgbW10aa1/ek05+UqH80JmbIVBKULrs8Oh9sZPKBDVLDRrGLshlmrI4OWBFQgi5HxC1dk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748366299; c=relaxed/simple; bh=OkvQw1nBc3rJ48l5uHJ2yuOYe1jEI0CnrbkbLw6tzO4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nDxVqqjHy+KBUXQrl4F04JE3HiiY+Cl6TdzWGMnjfsoBhxMXOxfuA2pZWkbvjOZ02fqQiuNZCWIwJVHwJaDYza+imMQtwhpoPgy4cpN8zoqVm1rpr0eeC5ZESyVOSkO/Wj2JpKN1pB6LRBP/fkpmxeeb5eEJbWDrfn2NJimXHDE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=mabIF8FQ; 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="mabIF8FQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF318C4CEE9; Tue, 27 May 2025 17:18:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748366299; bh=OkvQw1nBc3rJ48l5uHJ2yuOYe1jEI0CnrbkbLw6tzO4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mabIF8FQjjyKxkJHU6qxk9/GemcZX3+aB+HBhmYJwesWiFUo0LLNkJLTPolCZbar7 4uWTl9FNSr8knlWQzhrAs2O1fVygc5ar5tMmcbsjjliwtmryo0lwFxTdNbMRDZjg50 f7mjZJllFyJZfpUSKeZWrMaPA+p5X5Lj0HodAMXI= 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 6.14 016/783] scsi: target: iscsi: Fix timeout on deleted connection Date: Tue, 27 May 2025 18:16:53 +0200 Message-ID: <20250527162513.708589964@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250527162513.035720581@linuxfoundation.org> References: <20250527162513.035720581@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.14-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 1244ef3aa86c1..620ba6e0ab075 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -4263,8 +4263,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