Skip to main content

CVE-2021-47317: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2021-47317cvecve-2021-47317
Published: Tue May 21 2024 (05/21/2024, 14:35:33 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: powerpc/bpf: Fix detecting BPF atomic instructions Commit 91c960b0056672 ("bpf: Rename BPF_XADD and prepare to encode other atomics in .imm") converted BPF_XADD to BPF_ATOMIC and added a way to distinguish instructions based on the immediate field. Existing JIT implementations were updated to check for the immediate field and to reject programs utilizing anything more than BPF_ADD (such as BPF_FETCH) in the immediate field. However, the check added to powerpc64 JIT did not look at the correct BPF instruction. Due to this, such programs would be accepted and incorrectly JIT'ed resulting in soft lockups, as seen with the atomic bounds test. Fix this by looking at the correct immediate value.

AI-Powered Analysis

AILast updated: 06/26/2025, 10:53:43 UTC

Technical Analysis

CVE-2021-47317 is a vulnerability identified in the Linux kernel specifically affecting the powerpc64 Just-In-Time (JIT) compiler implementation for Berkeley Packet Filter (BPF) atomic instructions. The issue stems from an incorrect check in the JIT compiler for BPF atomic instructions after a kernel commit (91c960b0056672) that renamed BPF_XADD to BPF_ATOMIC and introduced a mechanism to distinguish atomic instructions based on the immediate field. While other architectures updated their JIT implementations to correctly validate the immediate field and reject unsupported atomic operations, the powerpc64 JIT failed to inspect the correct immediate value. This flaw allowed certain BPF programs using atomic instructions beyond BPF_ADD (such as BPF_FETCH) to be accepted and incorrectly JIT-compiled. The consequence of this incorrect compilation is a kernel soft lockup, effectively causing the system to hang or become unresponsive. The vulnerability does not appear to have been exploited in the wild yet, and it requires the presence of vulnerable Linux kernel versions containing the specific commit. The issue is technical and low-level, affecting the kernel's BPF JIT compiler on powerpc64 architectures, which are less common than x86_64 but still in use in some enterprise and specialized environments. The fix involves correcting the immediate value check in the powerpc64 JIT to properly reject unsupported atomic instructions, preventing the soft lockup condition.

Potential Impact

For European organizations, the impact of CVE-2021-47317 is primarily related to availability. A successful exploitation leads to a kernel soft lockup, causing affected systems to hang and potentially require a reboot. This can disrupt critical services, especially in environments relying on powerpc64 Linux servers for networking, telecommunications, or specialized computing tasks. Although the vulnerability does not directly expose confidentiality or integrity risks, the denial of service effect can impact operational continuity. Organizations using powerpc64 Linux systems in data centers or embedded systems may experience service outages or degraded performance. Since the vulnerability is in the kernel's BPF JIT compiler, which is often used for performance optimization in packet filtering and monitoring, network security appliances or monitoring tools running on vulnerable kernels could be affected. However, the lack of known exploits in the wild and the specialized nature of the affected architecture somewhat limits the immediate risk. Nonetheless, organizations with powerpc64 infrastructure should prioritize patching to avoid potential disruptions.

Mitigation Recommendations

1. Identify and inventory all Linux systems running on powerpc64 architectures within the organization to assess exposure. 2. Verify kernel versions and check for the presence of the vulnerable commit (91c960b0056672) or related kernel versions. 3. Apply the official Linux kernel patches that correct the immediate value check in the powerpc64 BPF JIT compiler as soon as they become available from trusted sources or Linux distributions. 4. If patching is not immediately possible, consider disabling BPF JIT compilation on powerpc64 systems as a temporary workaround to prevent exploitation, understanding this may impact performance. 5. Monitor system logs and kernel messages for signs of soft lockups or unusual BPF program loading activities. 6. Implement strict controls on who can load BPF programs on affected systems, limiting to trusted users and processes to reduce risk of triggering the vulnerability. 7. Engage with Linux distribution vendors for backported patches and security advisories relevant to powerpc64 platforms. 8. Incorporate this vulnerability into vulnerability management and incident response plans to ensure timely detection and remediation.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-05-21T14:28:16.973Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9835c4522896dcbea3fe

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

Last enriched: 6/26/2025, 10:53:43 AM

Last updated: 8/5/2025, 6:57:54 PM

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