From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 EEE1B47ACC4; Sat, 12 Sep 2026 11:53:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789214020; cv=none; b=D9/l0SS6B8TgYvMcIduZEAGwrXumB/HU2nsyaX00H7P3lwifQoNWwfGu4aJjWHRcPOHfphIf8evQbwF2vry8sSwRiee+GwaU7rTZWDrGJr1sBPGIgMKKOR3+aVeaV1Ob//Hhk5TH4TWyWoenAQ9JeDSnvIwZAYMCkKPKE2YwSIY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789214020; c=relaxed/simple; bh=WM7f0yAarBKnsFWRQYMBrYeOl8PySneA2eU87RKN9gU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BOdhivL5IpOHRdzR1uAAXT+gc8gOh1Quk6cEzh6/T9bZ9rt19jiFesK8a+zTt56GMLr14IQgM3yxLUZU0U/QFiFOVE6fMvrRFRmXv8PLUUG+rGTh+xbcYwNCc0O4xYOh+HrEGVW1FpJErOVuaN0/pVfc6x0wVYe8Pbn4XX55y7M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Q7UF6JPT; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Q7UF6JPT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5527E1F00898; Sat, 12 Sep 2026 11:53:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789214016; bh=bWjQ6GSBU4K013d4R1XhUGBAjFKKNWnAsMWBq3GiNSo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Q7UF6JPTV08WrxImAGJHTiD6whw4zeVHM/b0lgt24xzlI4FboRz4FGeHyHmFa5RIT 59wJmRlbfXhLdXxwQNDGc0Flhco8XNgEPBMBop8oa6C5ZsA9wx0nH1woEaIlhIJK/w A7cM8KXWvj0HHFIAwc0yQHV3oNwcZchslJM3IWxM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sashiko , Nilesh Javali , "Martin K. Petersen (Oracle)" Subject: [PATCH 6.12 0241/1376] scsi: qla2xxx: Avoid req_q_map double-read in qla2x00_error_entry() Date: Sat, 12 Sep 2026 08:44:27 +0200 Message-ID: <20260912065612.911911191@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.535295758@linuxfoundation.org> References: <20260912065607.535295758@linuxfoundation.org> User-Agent: quilt/0.69 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.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nilesh Javali commit deb8abde83a799d2501f3977f6d6051000253f5e upstream. qla2x00_error_entry() reads ha->req_q_map[que] twice: once for the NULL check and again when assigning it to req. The map slot is cleared by qla25xx_free_req_que() (ha->req_q_map[que_id] = NULL under mq_lock) during queue teardown, while the response-queue interrupt that drives qla2x00_error_entry() is still registered (the IRQ is released later in qla25xx_free_rsp_que()). If the slot is set to NULL between the two reads, req becomes NULL and is dereferenced. Read the slot once into req and NULL-check the local before use. mq_lock is a mutex and cannot be taken from interrupt context, so the single read plus local check is the appropriate fix for the reported NULL dereference. Fixes: a6fe35c052c4 ("[SCSI] qla2xxx: Avoid invalid request queue dereference for bad response packets.") Cc: stable@vger.kernel.org Reported-by: Sashiko Signed-off-by: Nilesh Javali Link: https://patch.msgid.link/20260730155838.2119230-17-njavali@marvell.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_isr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -3809,10 +3809,12 @@ qla2x00_error_entry(scsi_qla_host_t *vha "iocb type %xh with error status %xh, handle %xh, rspq id %d\n", pkt->entry_type, pkt->entry_status, pkt->handle, rsp->id); - if (que >= ha->max_req_queues || !ha->req_q_map[que]) + if (que >= ha->max_req_queues) goto fatal; req = ha->req_q_map[que]; + if (!req) + goto fatal; if (pkt->entry_status & RF_BUSY) res = DID_BUS_BUSY << 16;