CVE-2025-38236
BaseFortify
Publication date: 2025-07-08
Last updated on: 2025-12-18
Assigner: kernel.org
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| linux | linux_kernel | 6.16 |
| linux | linux_kernel | From 6.7 (inc) to 6.12.36 (inc) |
| debian | debian_linux | 11.0 |
| linux | linux_kernel | * |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-416 | The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability is a use-after-free issue in the Linux kernel's AF_UNIX socket implementation. Specifically, it occurs in the unix_stream_read_generic() function when handling out-of-band (OOB) data in UNIX domain sockets. The problem arises because consumed OOB socket buffers (skbs) are left consecutively on the receive queue, which leads to accessing freed memory during subsequent recv() calls. This can cause kernel memory corruption and crashes. The fix involves freeing previously consumed OOB skbs to prevent consecutive consumed OOB skbs from remaining on the queue.
How can this vulnerability impact me? :
This vulnerability can lead to kernel memory corruption due to use-after-free, potentially causing system crashes or instability. An attacker able to send crafted OOB data over UNIX domain sockets could exploit this to trigger a kernel crash or possibly execute arbitrary code with kernel privileges, impacting system reliability and security.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by reproducing the issue using the provided Python socketpair code that sends and receives out-of-band (OOB) data on AF_UNIX sockets, which triggers the use-after-free condition. The sequence involves sending OOB data with MSG_OOB flags and receiving it in a specific order to leave consumed OOB skbs. Monitoring kernel logs for KASAN (Kernel Address Sanitizer) slab-use-after-free errors related to unix_stream_read_actor or unix_stream_read_generic functions can also indicate the presence of this vulnerability. The exact commands to reproduce the issue are shown in the description using Python3 with socketpair and send/recv calls with MSG_OOB.
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation involves updating the Linux kernel to a version where this vulnerability is fixed, as the issue is resolved by freeing consumed OOB skbs during reception to prevent consecutive consumed OOB skbs. Since the vulnerability is in the kernel's AF_UNIX socket handling, applying the vendor's kernel patch or upgrading to a fixed kernel version is the recommended step. Avoid running untrusted code that can exploit AF_UNIX socket OOB data handling until the patch is applied.