CVE-2022-49548·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: bpf: Fix potential array overflow in bpf_trampoline_get_progs() The cnt value in the 'cnt >= BPF_MAX_TRAMP_PROGS' check does not include BPF_TRAMP_MODIFY_RETURN bpf programs, so the number of the attached BPF_TRAMP_MODIFY_RETURN bpf programs in a trampoline can exceed BPF_MAX_TRAMP_PROGS. When this happens, the assignment '*progs++ = aux->prog' in bpf_trampoline_get_progs() will cause progs array overflow as the progs field in the bpf_tramp_progs struct can only hold at most BPF_MAX_TRAMP_PROGS bpf programs.
- Severity
- high
- Software
- Kernel
- Fixed in
- 5.18.2
- Published
- 2025-02-26
Affected versions
From: 5.18
Until: 5.18.2
Fixed in: 5.18.2
How to fix this CVE
Update your Linux kernel to version 5.18.2 or later to fix a critical array overflow vulnerability in the BPF trampoline mechanism. This vulnerability allows a local unprivileged user to bypass memory bounds checking in the kernel's BPF program attachment logic. Kernel updates should be tested in a staging environment before production deployment, and systems should be rebooted after patching.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check your current kernel version with `uname -r` and compare against the affected range (5.18.0 to 5.18.2)
- Step 2: Verify BPF is enabled in your kernel by checking if `/sys/kernel/debug/tracing/` directory exists and BPF syscall is available via `grep -i bpf /boot/config-$(uname -r)`
- Step 3: Monitor kernel logs for BPF-related errors with `dmesg | grep -i 'bpf\|trampoline'` to detect failed BPF program attachments
- Step 4: After updating to kernel 5.18.2+, confirm the patch is applied by verifying the kernel version with `uname -r` and checking that BPF operations complete without array overflow errors
FAQ
What is CVE-2022-49548?
This vulnerability exists in the BPF trampoline mechanism where the kernel fails to properly account for BPF_TRAMP_MODIFY_RETURN programs when enforcing attachment limits, allowing an unbounded number of these programs to be attached and causing an out-of-bounds write into a fixed-size array.
Is CVE-2022-49548 being actively exploited?
No, this vulnerability is not listed in CISA's Known Exploited Vulnerabilities catalog, and no public exploits are currently available. However, it remains a high-severity local privilege escalation risk.
What versions of Kernel are affected by CVE-2022-49548?
Linux kernel versions 5.18.0 through 5.18.2 are affected. The fix was introduced in kernel 5.18.2 and later versions.
How do I check if my server is vulnerable to CVE-2022-49548?
Run `uname -r` and verify your kernel version. If it shows 5.18.0, 5.18.1, or 5.18.2, your system is potentially vulnerable unless the stable patch has been backported. Additionally, check `grep BPF_MAX_TRAMP_PROGS /boot/config-$(uname -r)` to confirm BPF is enabled.
Does Defensia detect CVE-2022-49548?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel is installed on a monitored server, CVE-2022-49548 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/32c4559c61652f24c9fdd5440342196fe37453bc
- https://git.kernel.org/stable/c/4f8897bcc20b9ae44758e0572538d741ab66f0dc
- https://git.kernel.org/stable/c/7f845de2863334bed4f362e95853f5e7bc323737
- https://git.kernel.org/stable/c/a2aa95b71c9bbec793b5c5fa50f0a80d882b3e8d
- https://git.kernel.org/stable/c/e36452d5da6325df7c10cffc60a9e68d21e2606d
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2022-49548. Free for 1 server.
Get started free