CVE-2026-99827: iov_iter: fix NULL deref in iov_iter_alignment()
In the Linux kernel, the following vulnerability has been resolved:
ioviter: fix NULL deref in ioviteralignment()
Since commit 111a12b422a8 ("iouring/rsrc: reject zero-length fixed buffer import") ioimportfixed() hands out an empty ITERBVEC for a zero-length request. Its count is 0 and its bvec array is NULL.
ioviteralignment() only checks the count for ITERUBUF. For ITERBVEC it calls ioviteralignmentbvec() and the do-while loop in there reads bvec->bvlen before it looks at the count. So it dereferences NULL.
btrfs checks the alignment of a direct read with ioviteralignment() before it looks at the count and f2fs does the same. So any user that can open a file on btrfs can oops the kernel with a single zero-length IORINGOPREADFIXED on an ODIRECT file descriptor. With IOSQEASYNC the oops happens in an io-wq worker. The dead worker stays on the worker list and when the task that submitted the request exits io-wq writes to the freed taskstruct of the worker. That's just fallout from the oops though.
Empty iterators with a NULL array aren't unusual. afs, tls and tipc create them as well. So leave iouring alone and make ioviteralignment() return 0 for an empty iterator of any type.