Skip to main content

CVE-2023-52803: Vulnerability in Linux Linux

High
VulnerabilityCVE-2023-52803cvecve-2023-52803
Published: Tue May 21 2024 (05/21/2024, 15:31:15 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: SUNRPC: Fix RPC client cleaned up the freed pipefs dentries RPC client pipefs dentries cleanup is in separated rpc_remove_pipedir() workqueue,which takes care about pipefs superblock locking. In some special scenarios, when kernel frees the pipefs sb of the current client and immediately alloctes a new pipefs sb, rpc_remove_pipedir function would misjudge the existence of pipefs sb which is not the one it used to hold. As a result, the rpc_remove_pipedir would clean the released freed pipefs dentries. To fix this issue, rpc_remove_pipedir should check whether the current pipefs sb is consistent with the original pipefs sb. This error can be catched by KASAN: ========================================================= [ 250.497700] BUG: KASAN: slab-use-after-free in dget_parent+0x195/0x200 [ 250.498315] Read of size 4 at addr ffff88800a2ab804 by task kworker/0:18/106503 [ 250.500549] Workqueue: events rpc_free_client_work [ 250.501001] Call Trace: [ 250.502880] kasan_report+0xb6/0xf0 [ 250.503209] ? dget_parent+0x195/0x200 [ 250.503561] dget_parent+0x195/0x200 [ 250.503897] ? __pfx_rpc_clntdir_depopulate+0x10/0x10 [ 250.504384] rpc_rmdir_depopulate+0x1b/0x90 [ 250.504781] rpc_remove_client_dir+0xf5/0x150 [ 250.505195] rpc_free_client_work+0xe4/0x230 [ 250.505598] process_one_work+0x8ee/0x13b0 ... [ 22.039056] Allocated by task 244: [ 22.039390] kasan_save_stack+0x22/0x50 [ 22.039758] kasan_set_track+0x25/0x30 [ 22.040109] __kasan_slab_alloc+0x59/0x70 [ 22.040487] kmem_cache_alloc_lru+0xf0/0x240 [ 22.040889] __d_alloc+0x31/0x8e0 [ 22.041207] d_alloc+0x44/0x1f0 [ 22.041514] __rpc_lookup_create_exclusive+0x11c/0x140 [ 22.041987] rpc_mkdir_populate.constprop.0+0x5f/0x110 [ 22.042459] rpc_create_client_dir+0x34/0x150 [ 22.042874] rpc_setup_pipedir_sb+0x102/0x1c0 [ 22.043284] rpc_client_register+0x136/0x4e0 [ 22.043689] rpc_new_client+0x911/0x1020 [ 22.044057] rpc_create_xprt+0xcb/0x370 [ 22.044417] rpc_create+0x36b/0x6c0 ... [ 22.049524] Freed by task 0: [ 22.049803] kasan_save_stack+0x22/0x50 [ 22.050165] kasan_set_track+0x25/0x30 [ 22.050520] kasan_save_free_info+0x2b/0x50 [ 22.050921] __kasan_slab_free+0x10e/0x1a0 [ 22.051306] kmem_cache_free+0xa5/0x390 [ 22.051667] rcu_core+0x62c/0x1930 [ 22.051995] __do_softirq+0x165/0x52a [ 22.052347] [ 22.052503] Last potentially related work creation: [ 22.052952] kasan_save_stack+0x22/0x50 [ 22.053313] __kasan_record_aux_stack+0x8e/0xa0 [ 22.053739] __call_rcu_common.constprop.0+0x6b/0x8b0 [ 22.054209] dentry_free+0xb2/0x140 [ 22.054540] __dentry_kill+0x3be/0x540 [ 22.054900] shrink_dentry_list+0x199/0x510 [ 22.055293] shrink_dcache_parent+0x190/0x240 [ 22.055703] do_one_tree+0x11/0x40 [ 22.056028] shrink_dcache_for_umount+0x61/0x140 [ 22.056461] generic_shutdown_super+0x70/0x590 [ 22.056879] kill_anon_super+0x3a/0x60 [ 22.057234] rpc_kill_sb+0x121/0x200

AI-Powered Analysis

AILast updated: 07/01/2025, 07:12:14 UTC

Technical Analysis

CVE-2023-52803 is a use-after-free vulnerability identified in the Linux kernel's SUNRPC (Sun Remote Procedure Call) client implementation, specifically related to the cleanup of pipefs dentries. The issue arises in the rpc_remove_pipedir() function, which is responsible for cleaning up pipefs superblock (sb) dentries associated with RPC clients. In certain edge cases, when the kernel frees the pipefs superblock of the current RPC client and immediately allocates a new pipefs superblock, rpc_remove_pipedir() may incorrectly assume the existence of the original pipefs sb. This misjudgment leads to the cleanup of already freed pipefs dentries, causing a use-after-free condition. This flaw can be detected by Kernel Address Sanitizer (KASAN) with error messages indicating slab-use-after-free in dget_parent(). The vulnerability stems from a race condition or timing issue in the management of pipefs superblocks, where the function does not verify that the current pipefs sb matches the original one it intended to clean up. The fix involves adding a consistency check in rpc_remove_pipedir() to ensure the pipefs sb being cleaned is indeed the one originally held, preventing the erroneous cleanup of freed dentries. Exploitation of this vulnerability could lead to kernel memory corruption, potentially causing system instability, crashes (kernel panics), or enabling privilege escalation if an attacker can manipulate the timing and state of pipefs superblocks. However, no known exploits are reported in the wild as of the publication date. The vulnerability affects Linux kernel versions identified by the commit hash 0157d021d23a087eecfa830502f81cfe843f0d16 and presumably other related versions. This vulnerability is technical and low-level, impacting the core kernel's RPC client subsystem, which is widely used in networked Linux environments.

Potential Impact

For European organizations, the impact of CVE-2023-52803 can be significant, especially for those relying heavily on Linux-based infrastructure and services that utilize RPC mechanisms, such as NFS (Network File System) servers, distributed storage systems, and cloud environments. Exploitation could lead to kernel crashes causing denial of service, disrupting critical business operations and services. More critically, if exploited in a targeted manner, it could allow attackers to execute arbitrary code with kernel privileges, leading to full system compromise. This risk is heightened in environments where multi-tenant systems or containerized workloads run on Linux kernels vulnerable to this flaw. Given the widespread use of Linux in European data centers, government agencies, financial institutions, and industrial control systems, the vulnerability poses a threat to confidentiality, integrity, and availability of sensitive data and services. Additionally, the complexity of the vulnerability and lack of known exploits may delay detection and patching, increasing the window of exposure. The vulnerability could also affect embedded Linux devices used in critical infrastructure, amplifying potential operational risks.

Mitigation Recommendations

European organizations should prioritize the following mitigation steps: 1) Apply the official Linux kernel patches that address CVE-2023-52803 as soon as they become available from trusted Linux distributions or kernel maintainers. 2) For environments where immediate patching is not feasible, consider isolating or limiting RPC client usage, especially in multi-tenant or exposed network segments, to reduce attack surface. 3) Employ kernel hardening techniques such as enabling Kernel Address Sanitizer (KASAN) in testing environments to detect use-after-free issues proactively. 4) Monitor system logs and kernel messages for anomalies related to RPC client pipefs operations or KASAN alerts that could indicate exploitation attempts. 5) Implement strict access controls and network segmentation to limit exposure of RPC services to untrusted networks or users. 6) Maintain up-to-date backups and incident response plans to recover quickly from potential kernel crashes or compromises. 7) Engage with Linux vendor security advisories and subscribe to vulnerability notifications to stay informed about patch releases and exploit developments. These measures go beyond generic advice by focusing on the specific subsystem affected and emphasizing proactive detection and containment strategies.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-05-21T15:19:24.247Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9830c4522896dcbe75fe

Added to database: 5/21/2025, 9:09:04 AM

Last enriched: 7/1/2025, 7:12:14 AM

Last updated: 8/4/2025, 6:15:33 AM

Views: 14

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats