5.5
MEDIUM
CVE-2024-49987
Linux Kernel bpftool Null Pointer Voor tratamiento
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.

INFO

Published Date :

Oct. 21, 2024, 6:15 p.m.

Last Modified :

Oct. 28, 2024, 4:23 p.m.

Source :

416baaa9-dc9f-4396-8d5f-8c081fb06d67

Remotely Exploitable :

No

Impact Score :

3.6

Exploitability Score :

1.8
Affected Products

The following products are affected by CVE-2024-49987 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Linux linux_kernel
References to Advisories, Solutions, and Tools

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2024-49987 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2024-49987 vulnerability over time.

Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.

  • Initial Analysis by [email protected]

    Oct. 28, 2024

    Action Type Old Value New Value
    Added CVSS V3.1 NIST AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
    Changed Reference Type https://git.kernel.org/stable/c/2e0f6f33f2aa87493b365a38a8fd87b8854b7734 No Types Assigned https://git.kernel.org/stable/c/2e0f6f33f2aa87493b365a38a8fd87b8854b7734 Patch
    Changed Reference Type https://git.kernel.org/stable/c/c208b02827eb642758cef65641995fd3f38c89af No Types Assigned https://git.kernel.org/stable/c/c208b02827eb642758cef65641995fd3f38c89af Patch
    Changed Reference Type https://git.kernel.org/stable/c/c2d9f9a7837ab29ccae0c42252f17d436bf0a501 No Types Assigned https://git.kernel.org/stable/c/c2d9f9a7837ab29ccae0c42252f17d436bf0a501 Patch
    Changed Reference Type https://git.kernel.org/stable/c/f04e2ad394e2755d0bb2d858ecb5598718bf00d5 No Types Assigned https://git.kernel.org/stable/c/f04e2ad394e2755d0bb2d858ecb5598718bf00d5 Patch
    Added CWE NIST CWE-476
    Added CPE Configuration OR *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions up to (excluding) 6.6.55 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.7 up to (excluding) 6.10.14 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.11 up to (excluding) 6.11.3
  • CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67

    Oct. 21, 2024

    Action Type Old Value New Value
    Added 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.
    Added Reference kernel.org https://git.kernel.org/stable/c/c2d9f9a7837ab29ccae0c42252f17d436bf0a501 [No types assigned]
    Added Reference kernel.org https://git.kernel.org/stable/c/2e0f6f33f2aa87493b365a38a8fd87b8854b7734 [No types assigned]
    Added Reference kernel.org https://git.kernel.org/stable/c/c208b02827eb642758cef65641995fd3f38c89af [No types assigned]
    Added Reference kernel.org https://git.kernel.org/stable/c/f04e2ad394e2755d0bb2d858ecb5598718bf00d5 [No types assigned]
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.
CWE - Common Weakness Enumeration

While CVE identifies specific instances of vulnerabilities, CWE categorizes the common flaws or weaknesses that can lead to vulnerabilities. CVE-2024-49987 is associated with the following CWEs:

Common Attack Pattern Enumeration and Classification (CAPEC)

Common Attack Pattern Enumeration and Classification (CAPEC) stores attack patterns, which are descriptions of the common attributes and approaches employed by adversaries to exploit the CVE-2024-49987 weaknesses.

CVSS31 - Vulnerability Scoring System
Attack Vector
Attack Complexity
Privileges Required
User Interaction
Scope
Confidentiality
Integrity
Availability