CVE-2025-40072
BaseFortify
Publication date: 2025-10-28
Last updated on: 2025-10-30
Assigner: kernel.org
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| linux | linux_kernel | 6.17.0-rc4 |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-UNKNOWN |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability is a NULL pointer dereference in the Linux kernel's fanotify subsystem. Specifically, the function do_fanotify_mark() does not check if the function mnt_ns_from_dentry() returns NULL before trying to access mntns->user_ns. If mnt_ns_from_dentry() returns NULL (which happens if the path is not a mount namespace object), dereferencing it causes a kernel NULL pointer dereference, leading to a crash or kernel panic. The issue is fixed by validating the return value of mnt_ns_from_dentry() before dereferencing it.
How can this vulnerability impact me? :
This vulnerability can cause a kernel NULL pointer dereference, which may crash the system or cause a denial of service (DoS) by crashing the kernel. An attacker or unprivileged user could potentially trigger this by invoking fanotify_mark() with certain parameters, leading to system instability or downtime.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by compiling and running the provided test program fanotify_nullptr.c before and after applying the patch. The commands to compile and test are: $ gcc fanotify_nullptr.c -o fanotify_nullptr $ mkdir A $ ./fanotify_nullptr $ unshare -Urm Before the patch, running './fanotify_nullptr' followed by 'unshare -Urm' causes the process to be killed due to a NULL pointer dereference. After the patch, the same commands result in an 'Invalid argument' error instead of a crash. Observing kernel logs for NULL pointer dereference oops messages related to do_fanotify_mark can also indicate the vulnerability is present.
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation involves applying the patch that adds validation of the return value of mnt_ns_from_dentry() before dereferencing it in do_fanotify_mark(). Until the patch is applied, avoid using fanotify_mark() with FAN_MARK_MNTNS on paths that are not mount namespace objects to prevent triggering the NULL pointer dereference.