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 345DB23D7DF for ; Fri, 3 Apr 2026 15:27:10 +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=1775230030; cv=none; b=CrJ5KzTgAfTtw04PXJamOtevNL1IDxn/uW3xtoNVwUrjiB9c6yaym/RrDypdvnDoKAiWFTYNaDLi7hXi7fJc4DBELhUq7iFBzk6LUSR/mo6BSRjOWlsM18vgo9ZTDPFIzWFLTJjnrMURXd3lcaS6/gFhqRhsJgixifM0KiNakSg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775230030; c=relaxed/simple; bh=8pABZe7wTpiLu2jNOaz1s1cEDl7Og4tl58daLU4PnJo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=a+0og6Z62IIBrGWh6sa993+9ljSoBoIjfwcADLwvXT8gmBqxI71lp6EpvUn5fYy3PKfrIENYQzx+1HJ5/yBLCb29VuiZTk4yVu4FJNa8gGVhySVOO9v7bivzHcEqDRiKJ/8AYDbOZvYe/X+IM+7k05Y58zhLD/C46/zF9RYbpmA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=I7u96WW3; 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="I7u96WW3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0709C4CEF7; Fri, 3 Apr 2026 15:27:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1775230030; bh=8pABZe7wTpiLu2jNOaz1s1cEDl7Og4tl58daLU4PnJo=; h=From:To:Cc:Subject:Date:Reply-To:From; b=I7u96WW3aPZRa2039sRlVDiLVF+EI4C9Zdw+J6RlX8HYEu7uUKr7fXmMcXBT9brdz 3lPF+HoLpyJnfS6+h71KPqtFOzV7y/MnGGNENQxB7SeSm2tLGNaHTij2VF2I+fJLd0 yfkVJh5IaOrft0Lo9OCq/pY2L/K5pbtNR6i55uf0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31399: nvdimm/bus: Fix potential use after free in asynchronous initialization Date: Fri, 3 Apr 2026 17:19:07 +0200 Message-ID: <2026040326-CVE-2026-31399-9b84@gregkh> X-Mailer: git-send-email 2.53.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3762; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=V7lY0q3mmKewineG44XLh9U2JTSQxoUp5fTVqU4VclI=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnnbzn/CPWNdVv8bfXU232bfRx3del0LJaym1R8xDDuy qbJi7L5O2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAivzgY5qeKPV7o2j5XIkBW cqWY8qXfpnlG3xgWXJgV0Xfz3sGo2Uv31SU/8cksE12wBAA= 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: nvdimm/bus: Fix potential use after free in asynchronous initialization Dingisoul with KASAN reports a use after free if device_add() fails in nd_async_device_register(). Commit b6eae0f61db2 ("libnvdimm: Hold reference on parent while scheduling async init") correctly added a reference on the parent device to be held until asynchronous initialization was complete. However, if device_add() results in an allocation failure the ref count of the device drops to 0 prior to the parent pointer being accessed. Thus resulting in use after free. The bug bot AI correctly identified the fix. Save a reference to the parent pointer to be used to drop the parent reference regardless of the outcome of device_add(). The Linux kernel CVE team has assigned CVE-2026-31399 to this issue. Affected and fixed versions =========================== Issue introduced in 4.20 with commit b6eae0f61db27748606cc00dafcfd1e2c032f0a5 and fixed in 6.1.167 with commit 9a0fb16ba5b372465a3a1ecd761c6fa911a4ab4d Issue introduced in 4.20 with commit b6eae0f61db27748606cc00dafcfd1e2c032f0a5 and fixed in 6.6.130 with commit e48bf8f1d2b12c1c5ba1f609edbd4cde5dadc20e Issue introduced in 4.20 with commit b6eae0f61db27748606cc00dafcfd1e2c032f0a5 and fixed in 6.12.78 with commit 2c638259ad750833fd46a0cf57672a618542d84c Issue introduced in 4.20 with commit b6eae0f61db27748606cc00dafcfd1e2c032f0a5 and fixed in 6.18.20 with commit a226e5b49e5fe8c98b14f8507de670189d191348 Issue introduced in 4.20 with commit b6eae0f61db27748606cc00dafcfd1e2c032f0a5 and fixed in 6.19.10 with commit 84af19855d1abdee3c9d57c0684e2868e391793c Issue introduced in 4.20 with commit b6eae0f61db27748606cc00dafcfd1e2c032f0a5 and fixed in 7.0-rc5 with commit a8aec14230322ed8f1e8042b6d656c1631d41163 Issue introduced in 4.4.164 with commit 8954771abdea5c34280870e35592c7226a816d95 Issue introduced in 4.9.137 with commit 3e63a7f25cc85d3d3e174b9b0e3489ebb7eaf4ab Issue introduced in 4.14.81 with commit 1490de2bb0836fc0631c04d0559fdf81545b672f Issue introduced in 4.18.19 with commit e31a8418c8df7e6771414f99ed3d95ba8aca4e05 Issue introduced in 4.19.2 with commit 4f1a55a4f990016406147cf3e0c9487bf83e50f0 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-2026-31399 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/nvdimm/bus.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/9a0fb16ba5b372465a3a1ecd761c6fa911a4ab4d https://git.kernel.org/stable/c/e48bf8f1d2b12c1c5ba1f609edbd4cde5dadc20e https://git.kernel.org/stable/c/2c638259ad750833fd46a0cf57672a618542d84c https://git.kernel.org/stable/c/a226e5b49e5fe8c98b14f8507de670189d191348 https://git.kernel.org/stable/c/84af19855d1abdee3c9d57c0684e2868e391793c https://git.kernel.org/stable/c/a8aec14230322ed8f1e8042b6d656c1631d41163