Skip to main content
CVE Vulnerability Database

CVE-2021-4023: Linux Kernel io-workqueue DOS Vulnerability

CVE-2021-4023 is a denial of service flaw in Linux Kernel's io-workqueue that allows local users to crash the system through improper io-uring cancellation. This article covers technical details, affected versions, and patches.

Published:

CVE-2021-4023 Overview

A flaw was found in the io-workqueue implementation in the Linux kernel versions prior to 5.15-rc1. The kernel can panic when an improper cancellation operation triggers the submission of new io-uring operations during a shortage of free space. This vulnerability allows a local user with permissions to execute io-uring requests to possibly crash the system, resulting in a denial of service condition.

Critical Impact

Local attackers with io-uring execution permissions can trigger a kernel panic, causing complete system unavailability and potential data loss from unexpected shutdowns.

Affected Products

  • Linux Linux Kernel (versions prior to 5.15-rc1)
  • Fedora 35

Discovery Timeline

  • 2022-03-10 - CVE CVE-2021-4023 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-4023

Vulnerability Analysis

This Denial of Service vulnerability affects the io-workqueue subsystem within the Linux kernel. The io-uring interface, introduced in Linux kernel 5.1, provides a high-performance asynchronous I/O mechanism. The vulnerability stems from improper handling of cancellation operations when the system is under resource pressure.

When a cancellation operation is improperly triggered during conditions where free space is limited, the io-workqueue implementation can inadvertently initiate new io-uring operations. This creates a race condition that leads to a kernel panic, effectively crashing the entire system.

The vulnerability requires local access and the ability to execute io-uring requests. While this limits the attack surface, systems that allow untrusted users to perform io-uring operations are particularly at risk. Container environments where io-uring access is not properly restricted may also be vulnerable.

Root Cause

The root cause of this vulnerability lies in the improper handling of resource exhaustion scenarios within the io-workqueue implementation. Specifically, the cancellation logic does not adequately account for the state where free space is depleted, leading to an attempt to submit new operations when the system cannot safely handle them. This results in an inconsistent internal state that triggers a kernel panic.

Attack Vector

This vulnerability requires local access to exploit. An attacker must have permissions to execute io-uring requests on the target system. The attack involves triggering specific cancellation operations during resource-constrained conditions.

The exploitation scenario involves:

  1. A local user with io-uring execution permissions initiates I/O operations
  2. The attacker manipulates conditions to create a shortage of free space
  3. A carefully timed cancellation operation is triggered
  4. The improper cancellation logic submits new io-uring operations during the shortage
  5. The kernel enters an inconsistent state and panics

This attack can be executed without user interaction and does not require elevated privileges beyond io-uring access permissions.

Detection Methods for CVE-2021-4023

Indicators of Compromise

  • Unexpected kernel panics with stack traces referencing io_wq or io-workqueue functions
  • System crashes occurring during high I/O workloads involving io-uring operations
  • Repeated system reboots without clear hardware failure indicators
  • Kernel log entries showing io-uring related errors prior to system crash

Detection Strategies

  • Monitor kernel logs for io-workqueue and io-uring related error messages
  • Implement audit rules to track io-uring system calls from unprivileged users
  • Deploy kernel crash dump analysis to identify exploitation attempts
  • Review system stability metrics for patterns of unexpected reboots

Monitoring Recommendations

  • Enable kernel crash dumps to capture diagnostic information during panics
  • Configure system monitoring to alert on unexpected kernel panics
  • Audit user permissions related to io-uring capabilities
  • Monitor resource utilization to detect abnormal memory or I/O patterns

How to Mitigate CVE-2021-4023

Immediate Actions Required

  • Upgrade the Linux kernel to version 5.15-rc1 or later
  • Restrict io-uring access to trusted users only where possible
  • Review container configurations to ensure io-uring syscalls are appropriately restricted
  • Monitor systems for signs of exploitation attempts

Patch Information

The vulnerability has been addressed in Linux kernel versions 5.15-rc1 and later. System administrators should update their kernel packages to the latest stable version from their distribution vendor. For systems running Fedora 35, ensure all available kernel updates have been applied.

Additional details regarding this vulnerability can be found in the Red Hat Bug Report.

Workarounds

  • Restrict io-uring access by limiting the io_uring_setup syscall using seccomp filters
  • Disable io-uring functionality for untrusted users or services where not required
  • Implement resource limits to reduce the likelihood of triggering the vulnerable code path
  • Use SELinux or AppArmor policies to restrict io-uring access to essential processes only

For container environments where kernel upgrades are not immediately possible, consider adding io-uring to the blocked syscall list in your container runtime configuration:

bash
# Example seccomp profile addition to block io_uring syscalls
# Add to your container seccomp profile
{
  "names": [
    "io_uring_setup",
    "io_uring_enter",
    "io_uring_register"
  ],
  "action": "SCMP_ACT_ERRNO"
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.