Vulnerability · Published Oct 21, 2024 · Assigned by Linux

CVE-2024-49987bpftool: Fix undefined behavior in qsort(NULL, 0, ...)

Medium 5.5

In plain English

A medium-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 14% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS NVD)5.5Medium
Exploit odds (30 days)0.2%top 85.5% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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 packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:13linux6.11.4-1DEBIAN-CVE-2024-49987
Debian:14linux6.11.4-1DEBIAN-CVE-2024-49987
Ubuntu:24.04:LTSlinux6.8.0-54.56UBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-aws6.8.0-1023.25UBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-aws-6.86.8.0-1023.25~22.04.1UBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-azure6.8.0-1025.30UBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-azure-6.116.11.0-1012.12~24.04.1UBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-azure-6.86.8.0-1025.30~22.04.1UBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-azure-nvidia6.8.0-1014.15UBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-gcp6.8.0-1024.26UBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-gcp-6.116.11.0-1011.11~24.04.1UBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-gcp-6.86.8.0-1024.26~22.04.1UBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-gke6.8.0-1019.23UBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-gkeop6.8.0-1006.8UBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-hwe-6.86.8.0-57.59~22.04.1UBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-ibm6.8.0-1022.22UBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-ibm-6.86.8.0-1023.23~22.04.1UBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-intel-iot-realtimeno fix listedUBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-54.56.1UBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.86.8.0-54.56.1~22.04.1UBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1022.25UBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-nvidia-6.116.11.0-1007.7UBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-nvidia-6.86.8.0-1022.25~22.04.2UBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-nvidia-lowlatency6.8.0-1022.25.2UBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-oem-6.116.11.0-1015.15UBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-oem-6.86.8.0-1024.24UBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-oracle6.8.0-1020.21UBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-oracle-6.86.8.0-1020.21~22.04.1UBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-raspi6.8.0-1019.23UBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-riscv6.8.0-53.55.1UBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-riscv-6.86.8.0-53.55.1~22.04.1UBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2024-49987
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2024-49987
Ubuntu:24.04:LTSlinux-xilinx6.8.0-1017.18UBUNTU-CVE-2024-49987

Affected products (as reported)

VendorProductVersions
Linux Linux d0fe92fb5e3df6991c640fb9205d880b68603259 – before c2d9f9a7837ab29ccae0c42252f17d436bf0a501d0fe92fb5e3df6991c640fb9205d880b68603259 – before 2e0f6f33f2aa87493b365a38a8fd87b8854b7734d0fe92fb5e3df6991c640fb9205d880b68603259 – before c208b02827eb642758cef65641995fd3f38c89afd0fe92fb5e3df6991c640fb9205d880b68603259 – before f04e2ad394e2755d0bb2d858ecb5598718bf00d5
Linux Linux 6.4

References