Linux kernel fragment misalignment in page_pool allocation
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 53e0961da1c7bbdabd1abebb20de403ec237ec09 · < dca1b51693c81eaf77e50980be373e01ae857394| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
page_pool: keep frag_offset aligned for odd-sized requests
page_pool_alloc_frag_netmem() rounds the requested fragment size with
size = ALIGN(size, dma_get_cache_alignment());
dma_get_cache_alignment() returns 1 unless the architecture defines ARCH_DMA_MINALIGN, which DMA-coherent architectures such as x86 do not. There the ALIGN() is a no-op and pool->frag_offset advances by the raw, unrounded size.
A single caller asking for an odd size then leaves frag_offset misaligned for every fragment carved out of that page afterwards. The pool is shared, so the damage is not confined to the caller that caused it.
The per-cpu system_page_pool used by generic XDP hits this. skb_pp_cow_data() allocates its fragments with the raw packet length:
size = min_t(u32, len, PAGE_SIZE); truesize = size; page = page_pool_dev_alloc(pool, &page_off, &truesize);
From the CVE record · Linux
The Linux kernel page_pool can return misaligned buffers after an odd-sized fragment request. On x86 systems with split lock detection, a later packet clone can panic the machine. The issue was reproduced locally with a generic-mode XDP program on loopback and a RAW IPPROTO_UDP socket; the input does not specify authentication or permission requirements.
Engineers running Linux kernels, including versions 6.12.101 and 7.1.8 where the issue was observed, should check their systems.