CVE-2026-100027: lib/buildid: reject file offsets that do not fit in pgoff_t

Published Nov 30, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

lib/buildid: reject file offsets that do not fit in pgofft

On a 32-bit kernel, parsing the build ID of a crafted ELF file can copy far more than the intended bytes into a 64-byte on-stack buffer in buildidparse(), corrupting the stack of whatever context fetches the build ID. This might be reachable without privilege: perf records a build ID for PERFRECORDMMAP2 on the no-fault path when a process mmaps its own file (buildidparsenofault() from perfeventmmap()), and BPF build-id stack maps do the same.

freadergetfolio() turns a 64-bit file offset into a page cache index with fileoff >> PAGESHIFT and passes it to filemapgetfolio(). pgofft is unsigned long, 32-bit on a 32-bit kernel, so an ELF64 ephoff of 2^44 + k PAGESIZE truncates to index k. filemapgetfolio() returns the cached folio at index k, whose foliopos() is far below the requested fileoff. In freaderfetch() the folio does not contain fileoff, so the "crossing folio boundaries" path computes partsz = foliooff + foliosz - fileoff as a large u64 (fileoff is much larger), and the following memcpy() truncates it to sizet and copies a page into the 64-byte buffer. On a 64-bit kernel the index is not truncated, the folio is not cached and the fetch returns -EFAULT, so only 32-bit kernels are affected.

Reject a file offset that cannot be represented as a page cache index before the lookup, so such a file fails the build ID parse cleanly as it already does on 64-bit.

Reproduced on i386 under QEMU with CONFIGSTACKPROTECTORSTRONG: mmapping a crafted ELF (ELFCLASS64, ephoff = 2^44) while a perf event with attr.buildid is open panics with "stack-protector: Kernel stack is corrupted in: buildidparse"; with this patch the parse returns -EFAULT and the mmap completes cleanly. Built for i386 with W=1, no new warnings.

Affected Software

1 affected component
Linux Linux kernel

Event History

Nov 30, 2026
CVE Published
via MITRE·01:23 PM
Data Sourced
via MITRE·01:23 PM
Description

Frequently Asked Questions

1

Which systems are exposed to the described offset truncation behavior?

The issue applies to 32-bit Linux kernels, where pgoff_t is 32-bit. The affected condition involves parsing a crafted ELF file with a large ELF64 program-header offset that truncates when converted to a page-cache index.

2

Can an unprivileged local process reach the vulnerable code path?

The description indicates that it might be reachable without privilege. A process can mmap its own crafted file, causing perf to record a build ID for PERF_RECORD_MMAP2 on the no-fault path; BPF build-ID stack maps can also invoke the same parsing behavior.

3

What is the security impact if the condition is triggered?

The malformed offset can cause substantially more than the intended data to be copied into a 64-byte stack buffer in __build_id_parse(). This corrupts the stack of the context fetching the build ID.

4

What does the fix do?

The fix rejects file offsets that cannot fit in pgoff_t, preventing the 64-bit file offset from truncating to an incorrect page-cache index on 32-bit kernels.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203