VYPR
High severity7.8NVD Advisory· Published Jul 4, 2025· Updated May 12, 2026

CVE-2025-38212

CVE-2025-38212

Description

In the Linux kernel, the following vulnerability has been resolved:

ipc: fix to protect IPCS lookups using RCU

syzbot reported that it discovered a use-after-free vulnerability, [0]

[0]: https://lore.kernel.org/all/67af13f8.050a0220.21dd3.0038.GAE@google.com/

idr_for_each() is protected by rwsem, but this is not enough. If it is not protected by RCU read-critical region, when idr_for_each() calls radix_tree_node_free() through call_rcu() to free the radix_tree_node structure, the node will be freed immediately, and when reading the next node in radix_tree_for_each_slot(), the already freed memory may be read.

Therefore, we need to add code to make sure that idr_for_each() is protected within the RCU read-critical region when we call it in shm_destroy_orphaned().

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

A use-after-free vulnerability in Linux kernel IPC (shm_destroy_orphaned) due to missing RCU protection during idr_for_each, allowing local privilege escalation.

Root

Cause

The vulnerability resides in the Linux kernel's IPC subsystem, specifically in the shm_destroy_orphaned() function. The function uses idr_for_each() to iterate over shared memory segments, but this iteration was only protected by a read-write semaphore (rwsem) and not by an RCU read-critical section. As a result, when idr_for_each() triggers radix_tree_node_free() via call_rcu(), the radix tree node can be freed immediately, leading to a use-after-free condition when the next node is accessed [1][2].

Exploitation

An attacker with local access to the system can trigger this bug by creating and destroying orphaned shared memory segments in a specific sequence. No special privileges beyond the ability to create IPC objects are required, making the attack surface relatively broad. The race condition occurs during the cleanup of orphaned segments, which can be induced by normal system operations or crafted by an unprivileged user [1].

Impact

Successful exploitation results in a use-after-free, which can be leveraged to corrupt kernel memory. This could lead to a denial of service (system crash) or, in more sophisticated attacks, local privilege escalation to gain root access. The vulnerability has been assigned a CVSS v3 score of 7.8 (High), reflecting the potential for complete compromise of confidentiality, integrity, and availability [1].

Mitigation

The Linux kernel has addressed this issue by adding an RCU read-critical section around the idr_for_each() call in shm_destroy_orphaned(). Patches have been backported to stable kernel versions [2][3][4]. Siemens has confirmed that SIMATIC S7-1500 CPU family devices are affected and recommends applying the available firmware updates [1]. Users should update their kernels to the latest stable release to mitigate the risk.

AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

2

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

11

News mentions

0

No linked articles in our index yet.