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 D3F0A30B507 for ; Fri, 5 Sep 2025 17:24:07 +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=1757093047; cv=none; b=bOr1HneFEffXYWWYjD2Oiv2CqdFwcu54+asgGbNDJ19XYxjg7Cw24Xlw91okVDNubP0Co60Cd/9CEPfVPAo7cEMKAmv7TJLNYCcdpVMLjY9jhtrGxIm9VYQi91loWuSA0EdlRtcloWb5T5Ow9eYn8zY6H3Sf4zd2DtTfMjl/CFc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757093047; c=relaxed/simple; bh=iXLQFykg/MClaYuzjLjxU4NxEgPDC2xoXS9uHeOzgpc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=WzTdNhfIHn70sWpUagMRcaVYiwunqLt//hyeBHeBo7qrEBZW6CkLm8E7n1dOjWqr+6IJke37azykH3lkkb0vNdrjhxUmEQDsF7ewyoem5P7VmQrgMAvCfsWNYRFfpu50MvYL1jYxDOHY6likNeSkWI/vflKFTULxAOBFH0ogBD0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SaxLQkkV; 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="SaxLQkkV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59DAFC4CEF1; Fri, 5 Sep 2025 17:24:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757093047; bh=iXLQFykg/MClaYuzjLjxU4NxEgPDC2xoXS9uHeOzgpc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=SaxLQkkVtY/neLGRdXkN2nQnwOIZuzSlTm0s2dxyz7myyPeVAyTTSVDp7Y5XB5jJ/ Nd4MD2A53wdw6aOy94BdtN7ajZrIv1W0OwKbi2p3kkHq80wkDMLRG+FXHnF7k5FN9M l7qLMjrtWhXw+XuF0v7FdcqT919Se3iCHZ2O3bV0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39721: crypto: qat - flush misc workqueue during device shutdown Date: Fri, 5 Sep 2025 19:21:34 +0200 Message-ID: <2025090552-CVE-2025-39721-0b5c@gregkh> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3713; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=wOxxRM+J6pAYY1BJm/zBfd5rDb2Ek5/TsJ3s9y8eeOU=; b=owGbwMvMwCRo6H6F97bub03G02pJDBm7pb/4HvulJn/Nc+aVySI3Ln6p03mzwVUmZcbkWZJyz pIGr3n3dcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEvMoY5tltrz32Ple/hzsw xfF0v1Zl2Xd2WYYFizQi/Ldn8B5Ntu+/89xJf5HzCvazAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: crypto: qat - flush misc workqueue during device shutdown Repeated loading and unloading of a device specific QAT driver, for example qat_4xxx, in a tight loop can lead to a crash due to a use-after-free scenario. This occurs when a power management (PM) interrupt triggers just before the device-specific driver (e.g., qat_4xxx.ko) is unloaded, while the core driver (intel_qat.ko) remains loaded. Since the driver uses a shared workqueue (`qat_misc_wq`) across all devices and owned by intel_qat.ko, a deferred routine from the device-specific driver may still be pending in the queue. If this routine executes after the driver is unloaded, it can dereference freed memory, resulting in a page fault and kernel crash like the following: BUG: unable to handle page fault for address: ffa000002e50a01c #PF: supervisor read access in kernel mode RIP: 0010:pm_bh_handler+0x1d2/0x250 [intel_qat] Call Trace: pm_bh_handler+0x1d2/0x250 [intel_qat] process_one_work+0x171/0x340 worker_thread+0x277/0x3a0 kthread+0xf0/0x120 ret_from_fork+0x2d/0x50 To prevent this, flush the misc workqueue during device shutdown to ensure that all pending work items are completed before the driver is unloaded. Note: This approach may slightly increase shutdown latency if the workqueue contains jobs from other devices, but it ensures correctness and stability. The Linux kernel CVE team has assigned CVE-2025-39721 to this issue. Affected and fixed versions =========================== Issue introduced in 5.18 with commit e5745f34113b758b45d134dec04a7df94dc67131 and fixed in 6.6.103 with commit 5858448a6c65d8ee3f8600570d3ce19febcb33be Issue introduced in 5.18 with commit e5745f34113b758b45d134dec04a7df94dc67131 and fixed in 6.12.44 with commit fe546f5c50fc474daca6bee72caa7ab68a74c33d Issue introduced in 5.18 with commit e5745f34113b758b45d134dec04a7df94dc67131 and fixed in 6.16.4 with commit e59a52e429e13df3feb34f4853a8e36d121ed937 Issue introduced in 5.18 with commit e5745f34113b758b45d134dec04a7df94dc67131 and fixed in 6.17-rc1 with commit 3d4df408ba9bad2b205c7fb8afc1836a6a4ca88a Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2025-39721 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/crypto/intel/qat/qat_common/adf_common_drv.h drivers/crypto/intel/qat/qat_common/adf_init.c drivers/crypto/intel/qat/qat_common/adf_isr.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/5858448a6c65d8ee3f8600570d3ce19febcb33be https://git.kernel.org/stable/c/fe546f5c50fc474daca6bee72caa7ab68a74c33d https://git.kernel.org/stable/c/e59a52e429e13df3feb34f4853a8e36d121ed937 https://git.kernel.org/stable/c/3d4df408ba9bad2b205c7fb8afc1836a6a4ca88a