CVE-2024-27046 - NULL Pointer Dereference

Severity

55%

Complexity

18%

Confidentiality

60%

In the Linux kernel, the following vulnerability has been resolved: nfp: flower: handle acti_netdevs allocation failure The kmalloc_array() in nfp_fl_lag_do_work() will return null, if the physical memory has run out. As a result, if we dereference the acti_netdevs, the null pointer dereference bugs will happen. This patch adds a check to judge whether allocation failure occurs. If it happens, the delayed work will be rescheduled and try again.

CVSS 3.1 Base Score 5.5. CVSS Attack Vector: local. CVSS Attack Complexity: low. CVSS Vector: (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).

Demo Examples

NULL Pointer Dereference

CWE-476

While there are no complete fixes aside from conscientious programming, the following steps will go a long way to ensure that NULL pointer dereferences do not occur.


               
}
/* make use of pointer1 *//* ... */

If you are working with a multithreaded or otherwise asynchronous environment, ensure that proper locking APIs are used to lock before the if statement; and unlock when it has finished.

NULL Pointer Dereference

CWE-476

This example takes an IP address from a user, verifies that it is well formed and then looks up the hostname and copies it into a buffer.


               
}
strcpy(hostname, hp->h_name);/*routine that ensures user_supplied_addr is in the right format for conversion */

If an attacker provides an address that appears to be well-formed, but the address does not resolve to a hostname, then the call to gethostbyaddr() will return NULL. Since the code does not check the return value from gethostbyaddr (CWE-252), a NULL pointer dereference would then occur in the call to strcpy().

Note that this example is also vulnerable to a buffer overflow (see CWE-119).

NULL Pointer Dereference

CWE-476

In the following code, the programmer assumes that the system always has a property named "cmd" defined. If an attacker can control the program's environment so that "cmd" is not defined, the program throws a NULL pointer exception when it attempts to call the trim() method.


               
cmd = cmd.trim();

NULL Pointer Dereference

CWE-476

This application has registered to handle a URL when sent an intent:


               
}......
}
}
int length = URL.length();
...

The application assumes the URL will always be included in the intent. When the URL is not present, the call to getStringExtra() will return null, thus causing a null pointer exception when length() is called.

Overview

First reported 9 months ago

2024-05-01 13:15:00

Last updated 2 months ago

2024-12-23 18:19:00

Affected Software

Linux Kernel

References

https://git.kernel.org/stable/c/d746889db75a76aeee95fb705b8e1ac28c684a2e

https://git.kernel.org/stable/c/3b1e8a617eb0f4cdc19def530047a95b5abde07d

https://git.kernel.org/stable/c/928705e341010dd910fdece61ccb974f494a758f

https://git.kernel.org/stable/c/0d387dc503f9a53e6d1f6e9dd0292d38f083eba5

https://git.kernel.org/stable/c/c9b4e220dd18f79507803f38a55d53b483f6c9c3

https://git.kernel.org/stable/c/408ba7fd04f959c61b50db79c983484312fea642

https://git.kernel.org/stable/c/c8df9203bf22c66fa26e8d8c7f8ce181cf88099d

https://git.kernel.org/stable/c/9d8eb1238377cd994829f9162ae396a84ae037b2

https://git.kernel.org/stable/c/84e95149bd341705f0eca6a7fcb955c548805002

https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html

https://lists.debian.org/debian-lts-announce/2024/06/msg00020.html

https://git.kernel.org/stable/c/0d387dc503f9a53e6d1f6e9dd0292d38f083eba5

Patch

https://git.kernel.org/stable/c/3b1e8a617eb0f4cdc19def530047a95b5abde07d

Patch

https://git.kernel.org/stable/c/408ba7fd04f959c61b50db79c983484312fea642

Patch

https://git.kernel.org/stable/c/84e95149bd341705f0eca6a7fcb955c548805002

Patch

https://git.kernel.org/stable/c/928705e341010dd910fdece61ccb974f494a758f

Patch

https://git.kernel.org/stable/c/9d8eb1238377cd994829f9162ae396a84ae037b2

Patch

https://git.kernel.org/stable/c/c8df9203bf22c66fa26e8d8c7f8ce181cf88099d

Patch

https://git.kernel.org/stable/c/c9b4e220dd18f79507803f38a55d53b483f6c9c3

Patch

https://git.kernel.org/stable/c/d746889db75a76aeee95fb705b8e1ac28c684a2e

Patch

https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html

Patch

https://lists.debian.org/debian-lts-announce/2024/06/msg00020.html

Patch

Stay updated

ExploitPedia is constantly evolving. Sign up to receive a notification when we release additional functionality.

Get in touch

If you'd like to report a bug or have any suggestions for improvements then please do get in touch with us using this form. We will get back to you as soon as we can.