CVE-2026-100027
published high CVSS 3.1 · 7.8lib/buildid: reject file offsets that do not fit in pgoff_t
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linuxde3ec364c3c37971dbba1e37a55ae5b646c6f24e to < 3e385811176cd7968b0ad687a4118e90632018f4 · de3ec364c3c37971dbba1e37a55ae5b646c6f24e to < 78b8738d6656acec8a0d812bf826a9a412f16971 · de3ec364c3c37971dbba1e37a55ae5b646c6f24e to < 34bd3e5f44a327e15c1a6513bae8267bda19b43f · de3ec364c3c37971dbba1e37a55ae5b646c6f24e to < 0007654a7bf13ef2a19afd398bbc6507087f19fd · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux6.12 (affected) · 0 to < 6.12 (unaffected · semver) · 6.12.117 through 6.12.* (unaffected · semver) · 6.18.63 through 6.18.* (unaffected · semver) · 7.3.4 through 7.3.* (unaffected · semver) · 7.4-rc1 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: lib/buildid: reject file offsets that do not fit in pgoff_t 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 __build_id_parse(), corrupting the stack of whatever context fetches the build ID. This might be reachable without privilege: perf records a build ID for PERF_RECORD_MMAP2 on the no-fault path when a process mmaps its own file (build_id_parse_nofault() from perf_event_mmap()), and BPF build-id stack maps do the same. freader_get_folio() turns a 64-bit file offset into a page cache index with file_off >> PAGE_SHIFT and passes it to filemap_get_folio(). pgoff_t is unsigned long, 32-bit on a 32-bit kernel, so an ELF64 e_phoff of 2^44 + k * PAGE_SIZE truncates to index k. filemap_get_folio() returns the cached folio at index k, whose folio_pos() is far below the requested file_off. In freader_fetch() the folio does not contain file_off, so the "crossing folio boundaries" path computes part_sz = folio_off + folio_sz - file_off as a large u64 (file_off is much larger), and the following memcpy() truncates it to size_t 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 CONFIG_STACKPROTECTOR_STRONG: mmapping a crafted ELF (ELFCLASS64, e_phoff = 2^44) while a perf event with attr.build_id is open panics with "stack-protector: Kernel stack is corrupted in: __build_id_parse"; with this patch the parse returns -EFAULT and the mmap completes cleanly. Built for i386 with W=1, no new warnings.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The malformed ELF64 e_phoff comes from a file the local user writes and maps with mmap(); __mmap_complete() -> perf_event_mmap() -> perf_event_mmap_event() -> build_id_parse_nofault() -> __build_id_parse() -> freader_fetch()/freader_get_folio() parse it. No remote protocol carries the data. AC:L - On an affected 32-bit kernel the attacker sets up every condition: e_phoff = 2^44 + j, pre-reading the file so filemap_get_folio() finds the truncated index's folio uptodate, and opening their own build_id perf event. After that the truncated-pgoff_t lookup and memcpy happen deterministically on mmap(). PR:L - At the default sysctl_perf_event_paranoid=2, an unprivileged user can open a per-task perf event on themselves with exclude_kernel=1, mmap=1 and build_id=1 (neither perf_allow_kernel() nor perf_allow_cpu() applies), which raises nr_build_id_events. Mapping their own file needs only a normal account. UI:N - The attacker does everything with their own syscalls (write the crafted ELF, read it into the page cache, perf_event_open, mmap); no other user or administrator has to act or mount anything. S:U - The overflow corrupts the kernel stack of the task calling mmap(). That is an ordinary local kernel compromise inside the same security authority, with no VM, IOMMU or sandbox boundary crossed. C:H - In freader_fetch() the truncated part_sz makes memcpy copy up to 4096-j attacker-chosen file bytes into the 64-byte buf[] in __build_id_parse(). A stack overflow with controlled length and content can corrupt saved registers and caller frames, which can lead to arbitrary kernel read. I:H - Overwriting __build_id_parse()'s frame and caller frames (saved registers, return address, caller locals) with fully attacker-controlled bytes is a control-flow-hijack primitive, so kernel integrity is fully exposed. A:H - Even with CONFIG_STACKPROTECTOR (default y) the overflow reliably panics with 'stack-protector: Kernel stack is corrupted in: __build_id_parse', and an unprivileged user can repeat it at will by mmapping the file.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | de3ec364c3c37971dbba1e37a55ae5b646c6f24e to < 3e385811176cd7968b0ad687a4118e90632018f4 (affected · git)de3ec364c3c37971dbba1e37a55ae5b646c6f24e to < 78b8738d6656acec8a0d812bf826a9a412f16971 (affected · git)de3ec364c3c37971dbba1e37a55ae5b646c6f24e to < 34bd3e5f44a327e15c1a6513bae8267bda19b43f (affected · git)de3ec364c3c37971dbba1e37a55ae5b646c6f24e to < 0007654a7bf13ef2a19afd398bbc6507087f19fd (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 6.12 (affected)0 to < 6.12 (unaffected · semver)6.12.117 through 6.12.* (unaffected · semver)6.18.63 through 6.18.* (unaffected · semver)7.3.4 through 7.3.* (unaffected · semver)7.4-rc1 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
4Provider assertions
1Linux · cna
lib/buildid: reject file offsets that do not fit in pgoff_t
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 7b6a829078f38662dbbaeae725b691c6ccbfbf7c97a5190a278f768668d48329
- Ingested
- 01 Dec 2026, 05:47:22 UTC
- Source record
- Official CVE record