Skip to main content

CVE-2023-52813: Vulnerability in Linux Linux

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

Description

In the Linux kernel, the following vulnerability has been resolved: crypto: pcrypt - Fix hungtask for PADATA_RESET We found a hungtask bug in test_aead_vec_cfg as follows: INFO: task cryptomgr_test:391009 blocked for more than 120 seconds. "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. Call trace: __switch_to+0x98/0xe0 __schedule+0x6c4/0xf40 schedule+0xd8/0x1b4 schedule_timeout+0x474/0x560 wait_for_common+0x368/0x4e0 wait_for_completion+0x20/0x30 wait_for_completion+0x20/0x30 test_aead_vec_cfg+0xab4/0xd50 test_aead+0x144/0x1f0 alg_test_aead+0xd8/0x1e0 alg_test+0x634/0x890 cryptomgr_test+0x40/0x70 kthread+0x1e0/0x220 ret_from_fork+0x10/0x18 Kernel panic - not syncing: hung_task: blocked tasks For padata_do_parallel, when the return err is 0 or -EBUSY, it will call wait_for_completion(&wait->completion) in test_aead_vec_cfg. In normal case, aead_request_complete() will be called in pcrypt_aead_serial and the return err is 0 for padata_do_parallel. But, when pinst->flags is PADATA_RESET, the return err is -EBUSY for padata_do_parallel, and it won't call aead_request_complete(). Therefore, test_aead_vec_cfg will hung at wait_for_completion(&wait->completion), which will cause hungtask. The problem comes as following: (padata_do_parallel) | rcu_read_lock_bh(); | err = -EINVAL; | (padata_replace) | pinst->flags |= PADATA_RESET; err = -EBUSY | if (pinst->flags & PADATA_RESET) | rcu_read_unlock_bh() | return err In order to resolve the problem, we replace the return err -EBUSY with -EAGAIN, which means parallel_data is changing, and the caller should call it again. v3: remove retry and just change the return err. v2: introduce padata_try_do_parallel() in pcrypt_aead_encrypt and pcrypt_aead_decrypt to solve the hungtask.

AI-Powered Analysis

AILast updated: 07/01/2025, 07:25:13 UTC

Technical Analysis

CVE-2023-52813 is a vulnerability identified in the Linux kernel's cryptographic subsystem, specifically within the pcrypt module that handles parallel cryptographic operations using the padata framework. The issue arises from a hungtask bug in the test_aead_vec_cfg function, which is part of the kernel's cryptographic self-test routines. The root cause is related to the handling of the PADATA_RESET flag during parallel asynchronous cryptographic operations. When the padata_do_parallel function returns an error code of -EBUSY due to the PADATA_RESET flag being set, it fails to call aead_request_complete(), which is necessary to signal completion of the cryptographic request. As a result, the test_aead_vec_cfg function blocks indefinitely on wait_for_completion(), causing a hung task and eventually a kernel panic with the message "hung_task: blocked tasks." The vulnerability stems from the improper error handling logic in padata_do_parallel, where the return value -EBUSY is used to indicate that parallel data is busy, but the caller is not instructed to retry. The fix implemented replaces the -EBUSY return code with -EAGAIN, signaling to the caller that the operation should be retried. Earlier patch versions introduced a retry mechanism, but the final fix simplifies this by only changing the error code. This vulnerability affects Linux kernel versions identified by the commit hash 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and potentially others in the same development line. The flaw is triggered during cryptographic operations that use the pcrypt module's parallel data processing, which may be exercised during kernel self-tests or by workloads relying on these cryptographic primitives. No known exploits are reported in the wild, and the vulnerability requires kernel-level code execution or privileged access to trigger the hung task condition. However, the impact is significant as it can cause kernel panics, leading to denial of service (DoS) on affected systems.

Potential Impact

For European organizations, the impact of CVE-2023-52813 primarily concerns systems running vulnerable Linux kernel versions that utilize the pcrypt cryptographic module, especially those performing cryptographic self-tests or parallel cryptographic operations. The vulnerability can cause kernel panics resulting in system crashes and service interruptions, which can disrupt critical infrastructure, cloud services, and enterprise IT environments. Organizations relying on Linux-based servers for sensitive operations, including financial institutions, healthcare providers, and government agencies, may face availability issues. The denial of service caused by this vulnerability could lead to operational downtime, loss of productivity, and potential cascading failures in distributed systems. Although exploitation requires privileged access or kernel-level code execution, insider threats or attackers who have already gained elevated privileges could leverage this flaw to destabilize systems. Additionally, automated testing or monitoring tools that trigger cryptographic self-tests might inadvertently cause system hangs if running on vulnerable kernels. The impact on confidentiality and integrity is limited since the vulnerability does not directly expose or modify data but focuses on availability through system crashes.

Mitigation Recommendations

To mitigate CVE-2023-52813, European organizations should: 1) Apply the official Linux kernel patches that replace the -EBUSY error code with -EAGAIN in the padata_do_parallel function, ensuring the fix is included in their kernel version. 2) Update Linux distributions to the latest stable kernel releases that incorporate this fix, prioritizing critical production systems and infrastructure servers. 3) Review and restrict access to kernel-level operations and cryptographic testing utilities to trusted administrators only, minimizing the risk of accidental or malicious triggering of the vulnerability. 4) Implement kernel crash monitoring and automated recovery mechanisms to reduce downtime in case of unexpected panics. 5) For environments running custom or embedded Linux kernels, coordinate with vendors or maintainers to backport the patch promptly. 6) Conduct thorough testing of cryptographic workloads and kernel self-tests in staging environments after patching to verify stability. 7) Monitor security advisories from Linux kernel maintainers and major Linux distributions for updates related to this vulnerability. These steps go beyond generic advice by emphasizing patch management, access control, and operational resilience specific to the cryptographic subsystem and kernel panic scenarios.

Need more detailed analysis?Get Pro

Technical Details

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

Threat ID: 682d9830c4522896dcbe764d

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

Last enriched: 7/1/2025, 7:25:13 AM

Last updated: 8/3/2025, 7:12:09 AM

Views: 11

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