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 68CA91D5160 for ; Sat, 18 Oct 2025 08:03:36 +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=1760774616; cv=none; b=umhVoxF7ccrJc6YKdQE4hD7JMfUxy7KX/gQ9sMceMNYLA3GHk0MY+QU7UfNI6DxnEW//w+VWvxmK2MxP3BtMpiKhzRy2Zcf6w0oqF8Dw7q8rlsSTpVOazhgghfEXX8aYNd3oj3+fEUQR9lU+x8TUk4cBRe0bNo7oKDhURMfyEUA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760774616; c=relaxed/simple; bh=j7dhOFAcmWfEJnG561dwb9l2QwWYlZh17Uxsd7gCMiY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=AJO0nFnfEqg+j4Xe6qLaYo30UJi0YvA1AEw8nSGrdVlgBc94ccKnQOnM5ejbECNTYCG9b9OxwIz0oVZf8ECVkGk0Y66MnYzGQL+c9etR87CX10VG9gEqMDtFEXxmQzHN8T3SI2QQEEwr+FDz+ZLnKB3i+u3cXeFPpYsr+/fVx0c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rERdYAw/; 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="rERdYAw/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D426C4CEF8; Sat, 18 Oct 2025 08:03:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1760774616; bh=j7dhOFAcmWfEJnG561dwb9l2QwWYlZh17Uxsd7gCMiY=; h=From:To:Cc:Subject:Date:Reply-to:From; b=rERdYAw/ZCt3Bi4G4mJcf374IdNe9wesofP7Zy5Le8c3ain4t3EQ5jyYX77BVCWRK A0FOPGEoJwpzgzO97irG5dXBYWSxfS6H2NwCTeyKwaXqgFWmJGkjmk7BGWr/tGg6Jp nsjRk6/RStCWXM5ZAVH4HMxHZf7vruByY1hoQZQU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-40001: scsi: mvsas: Fix use-after-free bugs in mvs_work_queue Date: Sat, 18 Oct 2025 10:03:27 +0200 Message-ID: <2025101826-CVE-2025-40001-76a0@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=2510; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=aLWCef15tJwMoFB9CUG6mNP2FCnDNDUohXqzKz2Ry9g=; b=owGbwMvMwCRo6H6F97bub03G02pJDBmfPc+dfBdue2z2PR7m/YVRih1NVcc3vVbdqZXWK2b3+ ETCa262jlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjItlSG+ZWH+qovrF2eK1mw O6nELd/hon5qH8OCxXnzOyJ4v0Q/667p6RY6Vxmz/4whAA== 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: scsi: mvsas: Fix use-after-free bugs in mvs_work_queue During the detaching of Marvell's SAS/SATA controller, the original code calls cancel_delayed_work() in mvs_free() to cancel the delayed work item mwq->work_q. However, if mwq->work_q is already running, the cancel_delayed_work() may fail to cancel it. This can lead to use-after-free scenarios where mvs_free() frees the mvs_info while mvs_work_queue() is still executing and attempts to access the already-freed mvs_info. A typical race condition is illustrated below: CPU 0 (remove) | CPU 1 (delayed work callback) mvs_pci_remove() | mvs_free() | mvs_work_queue() cancel_delayed_work() | kfree(mvi) | | mvi-> // UAF Replace cancel_delayed_work() with cancel_delayed_work_sync() to ensure that the delayed work item is properly canceled and any executing delayed work item completes before the mvs_info is deallocated. This bug was found by static analysis. The Linux kernel CVE team has assigned CVE-2025-40001 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.31 with commit 20b09c2992fefbe78f8cede7b404fb143a413c52 and fixed in 6.18-rc1 with commit 60cd16a3b7439ccb699d0bf533799eeb894fd217 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-40001 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/scsi/mvsas/mv_init.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/60cd16a3b7439ccb699d0bf533799eeb894fd217