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 2CDBDAD5A; Tue, 27 May 2025 16:46:53 +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=1748364413; cv=none; b=RbcSZAe6jnRYZbvJ+PUG85i1L7Z0ufH0idSsCgKAox6mma8ph6AXNH8DexFkfAqdJglzcfitTmpfSHyD1R0edG3MvpG/qXDd+I4Fcya3aRmOmFQJRHpUujOm59ec2SHhbjVzANGyIXDnids3MleNZ01p0Xb7q+cSj0x4JtJEFh4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748364413; c=relaxed/simple; bh=Od0ln3RzOGisXS+CvtlK58Ck8oKoRuUPykY4zh2pelw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NztDYqDD+VoVCx5DBNRUaldHrnjTC3ZHHjjVLcMO0+wSYLP1GVIXoO2HGWk+CyYpLxhnHwaYHslH1PQX+babAEZCKGaS9VNBgFMqggR5KyPcn+ZWmjMz7uAJmXxOyrrmBaQEjVcWZ75zuZ4prv17OE3j1D4NrbhnCc+dGhOIK7Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lTXMfONx; 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="lTXMfONx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9345C4CEEB; Tue, 27 May 2025 16:46:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748364413; bh=Od0ln3RzOGisXS+CvtlK58Ck8oKoRuUPykY4zh2pelw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lTXMfONx+GHq4MoQV+z19hu0sZnyGDWrNy56I9awOlN6OruNGj1Zu8kFeZ7ayJjVr NhbkJfL/qXhREPvuCR10++X1sshmjjYsNKah0KPqiCZNRId4gur4wq1+/rWTm7iYjB CQmj2uo0x5O4UBZL9nU+KGTZgKI8fFz69eXmppBs= 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.12 017/626] scsi: target: iscsi: Fix timeout on deleted connection Date: Tue, 27 May 2025 18:18:30 +0200 Message-ID: <20250527162445.760906891@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250527162445.028718347@linuxfoundation.org> References: <20250527162445.028718347@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 6.12-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 6002283cbebab..68bbdf3ee101d 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -4317,8 +4317,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