KernelScan.io

HIGH

nvdimm AsyncInit UAF

CVE-2026-31399

CVSS 7.8 / 10.0 NVD

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

KernelScan AI5.9MEDIUM

01

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().

02

Engine v0.2.0

Risk summary

Systems with NVDIMM hardware are vulnerable to a use-after-free in the asynchronous device registration path. A privileged local attacker (root) can trigger memory allocation failures during NVDIMM device registration— for example by reloading the driver or managing namespaces under memory pressure— leading to a use-after-free. This can result in information disclosure, kernel memory corruption, or kernel crashes.

Affecteddrivers/nvdimm/bus.c (nvdimm subsystem)

Vulnerability analysis

The root cause is accessing dev->parent after the device reference count drops to zero when device_add() fails in nd_async_device_register(). If device_add() fails, the first put_device() frees the device structure; the second put_device() and subsequent dev->parent access then operate on freed memory. The fix saves the parent pointer before device_add() so the parent reference can be dropped safely regardless of the outcome.

03

BranchFixed inPatch commit
4.104.10a36cf138500e
4.154.159a0fb16ba5b3
4.194.19e48bf8f1d2b1
4.204.202c638259ad75
4.54.56fc36c2a925c
5.105.10.253a226e5b49e5f
5.155.15.20384af19855d1a
6.16.1.167a8aec1423032
6.126.12.78
6.186.18.20
6.196.19.10
6.66.6.130
mainline7.0