CVE-2026-100099: nvme: bound FDP config log reads to the received buffer
In the Linux kernel, the following vulnerability has been resolved:
nvme: bound FDP config log reads to the received buffer
nvmequeryfdpgranularity() parses the FDP Configurations log using sizes the controller returns, without checking that they fit the buffer it was given. The log size is only bounded from above before kvmalloc(), so a size below the log header makes le16tocpu(h->numfdpc) read past the allocation, and a size of zero yields ZEROSIZEPTR and faults. Each configuration descriptor is then dereferenced (dsze while walking, and nrg and runs on the selected one) without checking that the whole descriptor lies within the buffer, so a descriptor at or past the end is read out of bounds. The out-of-bounds runs value is then exposed to userspace through /sys/block/nvmeXnY/queue/writestreamgranularity.
A device-supplied dsze that is not a multiple of eight also leaves the following descriptors unaligned, and the structure is not packed, so reading nrg and runs from one can fault on architectures without efficient unaligned access.
A malicious or buggy controller triggers this during namespace scan with a short FDP Configurations log:
[ 1.104828] BUG: KASAN: slab-out-of-bounds in nvmeallocns+0x39a6/0x4480 [ 1.104848] Read of size 8 at addr ffff888009fd8fe0 by task kworker/u8:3/52 [ 1.104852] [ 1.104857] CPU: 1 UID: 0 PID: 52 Comm: kworker/u8:3 Not tainted 7.3.0-rc6-00063-g0c2669a9f4a1 #1 PREEMPT(lazy) [ 1.104862] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.17.0-0-gb52ca86e094d-prebuilt.qemu.org 04/01/2014 [ 1.104866] Workqueue: async asyncrunentryfn [ 1.104873] Call Trace: [ 1.104876] <TASK> [ 1.104878] dumpstacklvl+0x66/0xa0 [ 1.104886] printreport+0xd0/0x630 [ 1.104893] ? nvmeallocns+0x39a6/0x4480 [ 1.104897] ? virtaddrvalid+0x209/0x3f0 [ 1.104903] ? nvmeallocns+0x39a6/0x4480 [ 1.104907] kasanreport+0xe4/0x120 [ 1.104913] ? nvmeallocns+0x39a6/0x4480 [ 1.104919] nvmeallocns+0x39a6/0x4480 [ 1.104926] ? pfxnvmeallocns+0x10/0x10 [ 1.104931] ? checkprevadd+0xfd/0xe80 [ 1.104942] ? lockacquire+0x18d/0x300 [ 1.104948] ? nvmefindgetns+0xbb/0x2e0 [ 1.104952] ? findheldlock+0x2b/0x80 [ 1.104956] ? nvmefindgetns+0x221/0x2e0 [ 1.104962] ? nvmefindgetns+0x231/0x2e0 [ 1.104967] ? nvmescanns+0x2e1/0x8d0 [ 1.104971] ? kfree+0x2e5/0x510 [ 1.104976] ? lockacquire+0x570/0x1b00 [ 1.104982] nvmescanns+0x56a/0x8d0 [ 1.104987] ? pfxnvmescanns+0x10/0x10 [ 1.104994] ? lockdephardirqsonprepare+0xdc/0x190 [ 1.104999] ? tracehardirqson+0x18/0x160 [ 1.105005] ? kvmclockgetcycles+0x19/0x40 [ 1.105011] ? pfxnvmescannsasync+0x10/0x10 [ 1.105015] asyncrunentryfn+0x8d/0x290 [ 1.105020] processonework+0x8ac/0x1b00 [ 1.105029] ? pfxprocessonework+0x10/0x10 [ 1.105034] ? lockacquire+0x18d/0x300 [ 1.105040] ? lockisheldtype+0x8f/0x100 [ 1.105046] ? pfxasyncrunentryfn+0x10/0x10 [ 1.105050] workerthread+0x4ee/0xe70 [ 1.105056] ? lockdephardirqsonprepare+0xdc/0x190 [ 1.105061] ? tracehardirqson+0x18/0x160 [ 1.105066] ? pfxworkerthread+0x10/0x10 [ 1.105071] ? pfxworkerthread+0x10/0x10 [ 1.105076] kthread+0x2ce/0x3b0 [ 1.105080] ? pfxkthread+0x10/0x10 [ 1.105085] retfromfork+0x52e/0x780 [ 1.105090] ? pfxretfromfork+0x10/0x10 [ 1.105094] ? switchto+0x572/0xde0 [ 1.105101] ? pfxkthread+0x10/0x10 [ 1.105105] retfromforkasm+0x1a/0x30 [ 1.105114] </TASK> [ 1.105116] [ 1.105117] Allocated by task 52: [ 1.105119] kasansavestack+0x33/0x60 [ 1.105123] kasansavetrack+0x14/0x30 [ 1.105126] kasankmalloc+0x8f/0xa0 [ 1.105129] kvmallocnodenoprof+0x2e1/0x820 [ 1.105134] nvmeallocns+0x1097/0x4480 [ 1.105138] nvmescanns+0x56a/0x8d0 [ 1.105142] asyncrunentryfn+0x8d/ ---truncated---