CVE-2022-49030
published high CVSS 3.1 · 7.8libbpf: Handle size overflow for ringbuf mmap
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linuxbf99c936f9478a05d51e9f101f90de70bee9a89c to < 8a549ab6724520aa3c07f47e0eba820293551490 · bf99c936f9478a05d51e9f101f90de70bee9a89c to < 0140e079a42064680394fff1199a7b5483688dec · bf99c936f9478a05d51e9f101f90de70bee9a89c to < 535a25ab4f9a45f74ba38ab71de95e97474922ed · bf99c936f9478a05d51e9f101f90de70bee9a89c to < 927cbb478adf917e0a142b94baa37f06279cc466 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux5.8 (affected) · 0 to < 5.8 (unaffected · semver) · 5.10.158 through 5.10.* (unaffected · semver) · 5.15.82 through 5.15.* (unaffected · semver) · 6.0.12 through 6.0.* (unaffected · semver) · 6.1 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 | AL2 | Release evaluationALAS2KERNEL-5.10-2023-025 | Fixed | Not stated | Amazon Linux assessment |
| Amazon Linux | AL2 | Release evaluationALAS2KERNEL-5.15-2023-012 | Fixed | Not stated | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2 | kernelaarch64 | Listed in advisory | Not stated | ALAS2KERNEL-5.10-2023-025 |
| Amazon Linux | AL2 | kernelaarch64 | Listed in advisory | Not stated | ALAS2KERNEL-5.15-2023-012 |
Show 6 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Amazon Linux | AL2 | kerneli686 | Listed in advisory | Not stated | ALAS2KERNEL-5.10-2023-025 |
| Amazon Linux | AL2 | kerneli686 | Listed in advisory | Not stated | ALAS2KERNEL-5.15-2023-012 |
| Amazon Linux | AL2 | kernelsrc | Listed in advisory | Not stated | ALAS2KERNEL-5.10-2023-025 |
| Amazon Linux | AL2 | kernelsrc | Listed in advisory | Not stated | ALAS2KERNEL-5.15-2023-012 |
| Amazon Linux | AL2 | kernelx86_64 | Listed in advisory | Not stated | ALAS2KERNEL-5.10-2023-025 |
| Amazon Linux | AL2 | kernelx86_64 | Listed in advisory | Not stated | ALAS2KERNEL-5.15-2023-012 |
Description
In the Linux kernel, the following vulnerability has been resolved: libbpf: Handle size overflow for ringbuf mmap The maximum size of ringbuf is 2GB on x86-64 host, so 2 * max_entries will overflow u32 when mapping producer page and data pages. Only casting max_entries to size_t is not enough, because for 32-bits application on 64-bits kernel the size of read-only mmap region also could overflow size_t. So fixing it by casting the size of read-only mmap region into a __u64 and checking whether or not there will be overflow during mmap.
Related advisories
Vendor advisories explicitly linked to 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 bug is in userspace libbpf (`ring_buffer__add` in tools/lib/bpf/ringbuf.c), reached only when a local process mmaps a BPF_MAP_TYPE_RINGBUF fd; no network or adjacent-protocol path exists. AC:L - Creating a 2GB (power-of-two) RINGBUF and calling ring_buffer__new/__add deterministically overflows `2 * max_entries` as u32, so mmap maps only one page; no race or attacker-uncontrollable layout is required. PR:L - Unprivileged local users can open this path when unprivileged BPF is enabled (common across much of the affected 5.8+ window), and CAP_BPF alone (not full root) suffices when unprivileged BPF is disabled. UI:N - The attacker runs an affected libbpf consumer end-to-end against their own (or an attacker-supplied) map fd; no separate victim action is required. S:U - Corruption is confined to the calling process’s address space; libbpf and its caller share one security authority with no VM/IOMMU/sandbox escape. C:H - With mask≈2GB-1 over a one-page mapping, ringbuf_process_ring indexes far beyond the VMA and can read adjacent readable mappings, and sample callbacks receive those wild pointers. I:H - On 64-bit, ringbuf_unmap_ring munmaps ~4GiB from a 4KiB mapping and tears down neighboring VMAs, a classic unmap/remap memory-corruption primitive that enables control-flow hijack in the process. A:H - Consume walks unmapped addresses and causes SIGSEGV, and the oversized munmap can unmap libraries/heap and crash the process; both are repeatable at will.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | bf99c936f9478a05d51e9f101f90de70bee9a89c to < 8a549ab6724520aa3c07f47e0eba820293551490 (affected · git)bf99c936f9478a05d51e9f101f90de70bee9a89c to < 0140e079a42064680394fff1199a7b5483688dec (affected · git)bf99c936f9478a05d51e9f101f90de70bee9a89c to < 535a25ab4f9a45f74ba38ab71de95e97474922ed (affected · git)bf99c936f9478a05d51e9f101f90de70bee9a89c to < 927cbb478adf917e0a142b94baa37f06279cc466 (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 5.8 (affected)0 to < 5.8 (unaffected · semver)5.10.158 through 5.10.* (unaffected · semver)5.15.82 through 5.15.* (unaffected · semver)6.0.12 through 6.0.* (unaffected · semver)6.1 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
4Provider assertions
2Linux · cna
libbpf: Handle size overflow for ringbuf mmap
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- cb6587f8ab62e28f5c2c4eb5aa3830ce4c5976142879699dd21c48c4166c8db8
- Ingested
- 23 Sep 2026, 08:04:03 UTC
- Source record
- Official CVE record