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 9D6B8550DB2; Wed, 9 Sep 2026 14:08:28 +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=1788962909; cv=none; b=LMjEjRBYCFD8ieT0NIab3fD+jCaS8dnlEp8GYRVWrsuCG9gsRrDzvMrF7tvBSW/9R6nVDuZsDkiH3mUUvCA6Nts4YjzXU/Sy1QEfzbNGd3NWSkVxyFZtC2hVxRSi1np+xhYJQB6F5zHmevstjM0StwbVfIfkcbQDGt7NYdAsES0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788962909; c=relaxed/simple; bh=IRclnOUQk1+duygaJ8JZvZdQ5y5E+mB81zMUDGINZZQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oin8SEU1ZuhfF02lR2uqLlP8fUx/fKtaiW9NOf4zP2mIR5YoOsVwaU8U3HGkwkStOt3iMSvW1aWV+u2YeUOwAjAVgDC9uAp+lhzRiJYWapq2O2er47a7ukw3YAZDacxbAt2Ud3tTNzH/rpJsm1OzHSTaBplkDrE5tgVqrYDWcO8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=X3lwmEk+; 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="X3lwmEk+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 038681F00A3A; Wed, 9 Sep 2026 14:08:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788962908; bh=DDlIUENdxO6e8+m3yqAHC5Bmjq6T3uGv6xylbqb4+UI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=X3lwmEk+v0/EAwOzOQKCUiWrh8rnhAPBc3xx5dIZGdLvbo0SLyC0fyKl6A0ZI/6gj MHBNO41U3IlOnzqJGNWH7zbxKv63WOwLGjB13be3z2MbRrAVDnwappktWrs8tnZQRH G/yu9mql0rehRwHvNVaSd90x5iZyzTYPwgpzHgIc= 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 7.2 431/556] scsi: qla2xxx: Zero mailbox struct in qla2x00_get_firmware_state() Date: Wed, 9 Sep 2026 15:41:51 +0200 Message-ID: <20260909134245.764387968@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260909134230.441546314@linuxfoundation.org> References: <20260909134230.441546314@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 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nilesh Javali commit 9efaa782845b4d5fb3e01242be0d06ebc7428d8f upstream. The mbx_cmd_t is allocated on the stack but left uninitialized. qla2x00_mailbox_command() has several early-return paths (PCI permanent failure, device failed, EEH busy, ISP abort pending, mailbox access timeout, purge mbox) that return without writing the input mailbox registers back into mcp->mb[]. qla2x00_get_firmware_state() then unconditionally copies mcp->mb[1..6] (and mb[12]) into the caller's states[] array regardless of the return value. On such a failure the copied values are uninitialized kernel stack memory, which is then exposed to userspace via the fw_state and mpi_fw_state sysfs handlers. Zero the mailbox struct so a failed query yields deterministic zeroed state instead of leaking stack contents. Fixes: 4d4df1932b6b ("[SCSI] qla2xxx: Add ISP84XX support.") Cc: stable@vger.kernel.org Reported-by: Sashiko Signed-off-by: Nilesh Javali Link: https://patch.msgid.link/20260730155838.2119230-9-njavali@marvell.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_mbx.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -2262,6 +2262,8 @@ qla2x00_get_firmware_state(scsi_qla_host if (!ha->flags.fw_started) return QLA_FUNCTION_FAILED; + memset(&mc, 0, sizeof(mc)); + mcp->mb[0] = MBC_GET_FIRMWARE_STATE; mcp->out_mb = MBX_0; if (IS_FWI2_CAPABLE(vha->hw))