CVE-2024-49987
bpftool: Fix undefined behavior in qsort(NULL, 0, ...)
Mitigation
- No fix listed yet: follow the vendor advisory.
Who should check
- Anyone running Linux >= d0fe92fb5e3df6991c640fb9205d880b68603259, < c2d9f9a7837ab29ccae0c42252f17d436bf0a501; >= d0fe92fb5e3df6991c640fb9205d880b68603259, < 2e0f6f33f2aa87493b365a38a8fd87b8854b7734; >= d0fe92fb5e3df6991c640fb9205d880b68603259, < c208b02827eb642758cef65641995fd3f38c89af; >= d0fe92fb5e3df6991c640fb9205d880b68603259, < f04e2ad394e2755d0bb2d858ecb5598718bf00d5
- Anyone running Linux 6.4
Vulnerability facts
- Affected
- Linux >= d0fe92fb5e3df6991c640fb9205d880b68603259, < c2d9f9a7837ab29ccae0c42252f17d436bf0a501; >= d0fe92fb5e3df6991c640fb9205d880b68603259, < 2e0f6f33f2aa87493b365a38a8fd87b8854b7734; >= d0fe92fb5e3df6991c640fb9205d880b68603259, < c208b02827eb642758cef65641995fd3f38c89af; >= d0fe92fb5e3df6991c640fb9205d880b68603259, < f04e2ad394e2755d0bb2d858ecb5598718bf00d5; Linux 6.4
- Fixed in
- Linux 2e0f6f33f2aa87493b365a38a8fd87b8854b7734
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 5.5 (v3.1, NVD)CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Local
- Attack complexity: Low
- Privileges required: Low
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: None
- Integrity impact: None
- Availability impact: High
- EPSS
- 0.30% chance of exploitation in 30 days (percentile 15, 2026-11-26)
- CWE
- CWE-476
- Modified
Description
In the Linux kernel, the following vulnerability has been resolved: bpftool: Fix undefined behavior in qsort(NULL, 0, ...) When netfilter has no entry to display, qsort is called with qsort(NULL, 0, ...). This results in undefined behavior, as UBSan reports: net.c:827:2: runtime error: null pointer passed as argument 1, which is declared to never be null Although the C standard does not explicitly state whether calling qsort with a NULL pointer when the size is 0 constitutes undefined behavior, Section 7.1.4 of the C standard (Use of library functions) mentions: "Each of the following statements applies unless explicitly stated otherwise in the detailed descriptions that follow: If an argument to a function has an invalid value (such as a value outside the domain of the function, or a pointer outside the address space of the program, or a null pointer, or a pointer to non-modifiable storage when the corresponding parameter is not const-qualified) or a type (after promotion) not expected by a function with variable number of arguments, the behavior is undefined." To avoid this, add an early return when nf_link_info is NULL to prevent calling qsort with a NULL pointer.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Linux | >= d0fe92fb5e3df6991c640fb9205d880b68603259, < c2d9f9a7837ab29ccae0c42252f17d436bf0a501; >= d0fe92fb5e3df6991c640fb9205d880b68603259, < 2e0f6f33f2aa87493b365a38a8fd87b8854b7734; >= d0fe92fb5e3df6991c640fb9205d880b68603259, < c208b02827eb642758cef65641995fd3f38c89af; >= d0fe92fb5e3df6991c640fb9205d880b68603259, < f04e2ad394e2755d0bb2d858ecb5598718bf00d5 | — | cvelist |
| Linux | 6.4 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2024-49987. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2024-49987.md Affected: Linux >= d0fe92fb5e3df6991c640fb9205d880b68603259, < c2d9f9a7837ab29ccae0c42252f17d436bf0a501; >= d0fe92fb5e3df6991c640fb9205d880b68603259, < 2e0f6f33f2aa87493b365a38a8fd87b8854b7734; >= d0fe92fb5e3df6991c640fb9205d880b68603259, < c208b02827eb642758cef65641995fd3f38c89af; >= d0fe92fb5e3df6991c640fb… Fixed in: Linux 2e0f6f33f2aa87493b365a38a8fd87b8854b7734 Steps: 1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
FAQ
Is CVE-2024-49987 being exploited?
There is no confirmed exploitation: CVE-2024-49987 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.30% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2024-49987?
Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).
Which versions are affected by CVE-2024-49987?
Linux >= d0fe92fb5e3df6991c640fb9205d880b68603259, < c2d9f9a7837ab29ccae0c42252f17d436bf0a501; >= d0fe92fb5e3df6991c640fb9205d880b68603259, < 2e0f6f33f2aa87493b365a38a8fd87b8854b7734; >= d0fe92fb5e3df6991c640fb9205d880b68603259, < c208b02827eb642758cef65641995fd3f38c89af; >= d0fe92fb5e3df6991c640fb9205d880b68603259, < f04e2ad394e2755d0bb2d858ecb5598718bf00d5; Linux 6.4.
Is there a fix for CVE-2024-49987?
Yes. Fixed in Linux 2e0f6f33f2aa87493b365a38a8fd87b8854b7734. No fix listed yet: follow the vendor advisory.
How do I check if I'm affected by CVE-2024-49987?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.