CVE-2026-143324: bpf: Don't move a MAP_FIXED address in arena_get_unmapped_area()
In the Linux kernel, the following vulnerability has been resolved:
bpf: Don't move a MAPFIXED address in arenagetunmappedarea()
The user range of an arena must not cross a 4 GiB boundary. Thus arenagetunmappedarea() asks the mm for 2 len bytes and rounds the result up if necessary. This is correct only if the mm finds a free range. With MAPFIXED the mm does no search and returns addr. For MAPFIXEDNOREPLACE, dommap() also sets MAPFIXED.
With MAPFIXED the arena is not at addr after roundup(). Thus mmap() removes mappings outside the range from addr to addr + len. It keeps a part of those in this range. Also, roundup() can wrap to address 0, and the test for address 0 is before it.
The arch code gets twice the length of the mapping. Thus it can refuse a valid MAPFIXED range. On s390 the arch code also grows the page table for the range. With the double length it can omit this step for a valid range.
The test for a crossing is not exact. Because ret is a long, ret >> 32 extends the sign, but the other side is unsigned. The sides are never equal for an address with bit 63 set, and roundup() always runs. Such user addresses exist on s390. arenamapalloc() does the same test with a u64.
With MAPFIXED, pass len to the mm. Return -EINVAL if the range crosses a boundary, as for address 0. Make ret unsigned, so that only these ranges get the error. On x86-64, if roundup() gives address 0 today, mmap() now fails with -EINVAL or with -ENOMEM from the mm. Today mmap() can also fail for the address after roundup(), for example with -ENOMEM, -EEXIST, -EPERM or -EBUSY.
Without MAPFIXED the mm must still find a free range of 2 len bytes inside the address space of the task. The range after roundup() is inside it, and roundup() cannot wrap. An address with bit 63 set now moves only if its range crosses a boundary.
For an arena, libbpf uses MAPFIXED only with mapextra, and arenamapalloc() refuses a mapextra range that crosses a boundary. A subsequent mmap() must use the range of the first mmap(). For mmap() of the map fd, this range comes from arenagetunmappedarea(), thus it crosses no boundary. arenamapalloc() still accepts a mapextra above TASKSIZE, and mmap() of such an arena fails.
Affected Software
Event History
Frequently Asked Questions
What conditions are required to trigger this issue?
The affected path is reached when a BPF arena mapping is requested with MAP_FIXED; MAP_FIXED_NOREPLACE also reaches it because do_mmap() sets MAP_FIXED. The supplied address and mapping length must exercise the arena address-placement logic, including its 4 GiB boundary handling.
What can happen if the issue is triggered?
The arena address can be rounded away from the MAP_FIXED address. As a result, mmap() can remove mappings outside the requested addr through addr + len range while retaining part of the mappings within that range; address rounding can also wrap to zero.
Are there architecture-specific concerns?
Yes. The description identifies s390 as having user addresses with bit 63 set, which causes the boundary-crossing comparison to behave incorrectly and always perform rounding. On s390, requesting twice the mapping length can also affect page-table growth handling for an otherwise valid fixed range.