{"id":"CVE-2022-49030","state":"PUBLISHED","title":"libbpf: Handle size overflow for ringbuf mmap","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nlibbpf: Handle size overflow for ringbuf mmap\n\nThe maximum size of ringbuf is 2GB on x86-64 host, so 2 * max_entries\nwill overflow u32 when mapping producer page and data pages. Only\ncasting max_entries to size_t is not enough, because for 32-bits\napplication on 64-bits kernel the size of read-only mmap region\nalso could overflow size_t.\n\nSo fixing it by casting the size of read-only mmap region into a __u64\nand checking whether or not there will be overflow during mmap.","publishedAt":"2024-10-21T20:06:34.571Z","updatedAt":"2026-08-05T08:53:34.621Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"bf99c936f9478a05d51e9f101f90de70bee9a89c","status":"affected","lessThan":"8a549ab6724520aa3c07f47e0eba820293551490","versionType":"git"},{"version":"bf99c936f9478a05d51e9f101f90de70bee9a89c","status":"affected","lessThan":"0140e079a42064680394fff1199a7b5483688dec","versionType":"git"},{"version":"bf99c936f9478a05d51e9f101f90de70bee9a89c","status":"affected","lessThan":"535a25ab4f9a45f74ba38ab71de95e97474922ed","versionType":"git"},{"version":"bf99c936f9478a05d51e9f101f90de70bee9a89c","status":"affected","lessThan":"927cbb478adf917e0a142b94baa37f06279cc466","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["tools/lib/bpf/ringbuf.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.8","versionType":"semver"},{"version":"5.10.158","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.82","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.0.12","status":"unaffected","lessThanOrEqual":"6.0.*","versionType":"semver"},{"version":"6.1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["tools/lib/bpf/ringbuf.c"]}],"references":["https://git.kernel.org/stable/c/8a549ab6724520aa3c07f47e0eba820293551490","https://git.kernel.org/stable/c/0140e079a42064680394fff1199a7b5483688dec","https://git.kernel.org/stable/c/535a25ab4f9a45f74ba38ab71de95e97474922ed","https://git.kernel.org/stable/c/927cbb478adf917e0a142b94baa37f06279cc466"],"weaknesses":[],"ingestedAt":"2026-10-29T20:05:26.763Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/49xxx/CVE-2022-49030.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-49030","state":"PUBLISHED","datePublished":"2024-10-21T20:06:34.571Z","dateUpdated":"2026-08-05T08:53:34.621Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-08-22T01:27:53.651Z"},"containers":{"cna":{"title":"libbpf: Handle size overflow for ringbuf mmap","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nlibbpf: Handle size overflow for ringbuf mmap\n\nThe maximum size of ringbuf is 2GB on x86-64 host, so 2 * max_entries\nwill overflow u32 when mapping producer page and data pages. Only\ncasting max_entries to size_t is not enough, because for 32-bits\napplication on 64-bits kernel the size of read-only mmap region\nalso could overflow size_t.\n\nSo fixing it by casting the size of read-only mmap region into a __u64\nand checking whether or not there will be overflow during mmap."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"bf99c936f9478a05d51e9f101f90de70bee9a89c","status":"affected","lessThan":"8a549ab6724520aa3c07f47e0eba820293551490","versionType":"git"},{"version":"bf99c936f9478a05d51e9f101f90de70bee9a89c","status":"affected","lessThan":"0140e079a42064680394fff1199a7b5483688dec","versionType":"git"},{"version":"bf99c936f9478a05d51e9f101f90de70bee9a89c","status":"affected","lessThan":"535a25ab4f9a45f74ba38ab71de95e97474922ed","versionType":"git"},{"version":"bf99c936f9478a05d51e9f101f90de70bee9a89c","status":"affected","lessThan":"927cbb478adf917e0a142b94baa37f06279cc466","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["tools/lib/bpf/ringbuf.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.8","versionType":"semver"},{"version":"5.10.158","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.82","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.0.12","status":"unaffected","lessThanOrEqual":"6.0.*","versionType":"semver"},{"version":"6.1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["tools/lib/bpf/ringbuf.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/8a549ab6724520aa3c07f47e0eba820293551490"},{"url":"https://git.kernel.org/stable/c/0140e079a42064680394fff1199a7b5483688dec"},{"url":"https://git.kernel.org/stable/c/535a25ab4f9a45f74ba38ab71de95e97474922ed"},{"url":"https://git.kernel.org/stable/c/927cbb478adf917e0a142b94baa37f06279cc466"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"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.\nAC: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.\nPR: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.\nUI: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.\nS: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.\nC: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.\nI: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.\nA: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."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T08:53:34.621Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"5.10.158"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"5.15.82"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"6.0.12"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"6.1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2022-49030","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2024-10-22T13:11:21.316890Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-10-22T13:18:35.905Z"}}]}}}