CVE-2026-99097: tee: shm: reject zero-sized allocations in tee_dyn_shm_alloc_helper()
In the Linux kernel, the following vulnerability has been resolved:
tee: shm: reject zero-sized allocations in teedynshmallochelper()
teedynshmallochelper() derives nrpages from a caller-supplied size and passes it to allocpagesexact() without checking it. For size == 0 nrpages is 0, and allocpagesexact(0) calls getorder(0), which is documented as undefined and returns BITSPERLONG - PAGESHIFT. The page allocator then trips its order > MAXPAGEORDER warning and fails the allocation; on a paniconwarn kernel that ends the boot.
This can be triggered by TEEIOCSHMALLOC with struct teeioctlshmallocdata where size is 0.
Reject a zero page count, as registershmhelper() already does for the register path.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Reject zero-sized allocations in tee_dyn_shm_alloc_helper() before deriving nr_pages or calling alloc_pages_exact().