libbpf: Handle size overflow for ringbuf mmap
Published Oct 21, 2024
7.8
HIGHCVSS 3.1
EPSS 0.28%
Description
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.
Affected products
-
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version
-
- Version 5.8StatusaffectedConstraints-
- Version 0StatusunaffectedConstraints<5.8
- Version 5.10.158StatusunaffectedConstraints<=5.10.*
- Version 5.15.82StatusunaffectedConstraints<=5.15.*
- Version 6.0.12StatusunaffectedConstraints<=6.0.*
- Version 6.1StatusunaffectedConstraints<=*
- Version
Default status is the baseline for the product, each version can override it (e.g. patched versions marked unaffected).
- ≥ 5.8 · < 5.10.158
- ≥ 5.11 · < 5.15.82
- ≥ 5.16 · < 6.0.12
- 6.1
- 6.1
- 6.1
- 6.1
- 6.1
- 6.1
- 6.1
No data.
Red Hat Enterprise Linux 6
kernel
Not affected
Red Hat Enterprise Linux 7
kernel
Not affected
Red Hat Enterprise Linux 7
kernel-rt
Not affected
Red Hat Enterprise Linux 8
kernel
Not affected
Red Hat Enterprise Linux 8
kernel-rt
Not affected
Red Hat Enterprise Linux 9
kernel
Not affected
Red Hat Enterprise Linux 9
kernel-rt
Not affected
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Enterprise Linux 6 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 7 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 7 | kernel-rt | Not affected | n/a |
| Red Hat Enterprise Linux 8 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 8 | kernel-rt | Not affected | n/a |
| Red Hat Enterprise Linux 9 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 9 | kernel-rt | Not affected | n/a |
No package ranges for this CVE.
Remediation
Red Hat statement
BPF is a privileged operation on RHEL Kernel.
References (10)
- https://access.redhat.com/security/cve/CVE-2022-49030 Vendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=2320776 Issue Tracking
- https://euvd.enisa.europa.eu/vulnerability/EUVD-2022-53914 Advisory
- https://git.kernel.org/stable/c/0140e079a42064680394fff1199a7b5483688dec Patch
- https://git.kernel.org/stable/c/535a25ab4f9a45f74ba38ab71de95e97474922ed Patch
- https://git.kernel.org/stable/c/8a549ab6724520aa3c07f47e0eba820293551490 Patch
- https://git.kernel.org/stable/c/927cbb478adf917e0a142b94baa37f06279cc466 Patch
- https://lore.kernel.org/linux-cve-announce/2024102155-CVE-2022-49030-cee8@gregkh/T
- https://nvd.nist.gov/vuln/detail/CVE-2022-49030
- https://www.cve.org/CVERecord?id=CVE-2022-49030
Change history (0)
No recorded changes yet.