CVE-2022-2602 Overview
CVE-2022-2602 is a Use-After-Free vulnerability in the Linux kernel affecting the interaction between io_uring and Unix socket SCM (Socket Control Message) garbage collection mechanisms. This flaw enables local attackers with low privileges to potentially escalate their privileges on vulnerable systems by exploiting a race condition in how the kernel handles file descriptor references during garbage collection.
Critical Impact
Local privilege escalation through kernel memory corruption, allowing attackers to gain root access on affected Linux systems.
Affected Products
- Linux Kernel (multiple versions)
- Canonical Ubuntu Linux 18.04 ESM
- Canonical Ubuntu Linux 20.04 LTS
- Canonical Ubuntu Linux 22.04 LTS
- Canonical Ubuntu Linux 22.10
Discovery Timeline
- 2024-01-08 - CVE-2022-2602 published to NVD
- 2024-11-21 - Last updated in NVD database
Technical Details for CVE-2022-2602
Vulnerability Analysis
This vulnerability exists in the Linux kernel's io_uring subsystem and its interaction with Unix domain socket garbage collection. The io_uring interface is a high-performance asynchronous I/O framework introduced in Linux kernel 5.1 that allows user-space applications to submit I/O requests without system call overhead for each operation.
The flaw arises from a broken interaction between io_uring file descriptor handling and the Unix socket garbage collection mechanism. When file descriptors are passed between processes using Unix domain sockets via SCM_RIGHTS, the kernel maintains reference counts to track ownership. The garbage collector is responsible for cleaning up file descriptors that are in-flight but no longer reachable.
The vulnerability occurs because the io_uring subsystem can hold references to file descriptors in a way that the Unix GC doesn't properly account for. This creates a window where the garbage collector may free a file structure while io_uring still holds a reference to it, resulting in a Use-After-Free condition.
Root Cause
The root cause is a synchronization issue (CWE-416: Use After Free) between two kernel subsystems. When a file descriptor registered with io_uring is also passed through a Unix socket, the garbage collection mechanism may incorrectly determine that the file descriptor is unreachable and free the underlying struct file. The io_uring subsystem then operates on freed memory when it attempts to use the now-invalid file reference.
This is fundamentally a reference counting and lifecycle management problem where two independent kernel subsystems have conflicting views of whether a kernel object is still in use.
Attack Vector
The attack requires local access to the target system with the ability to execute code. An attacker can exploit this vulnerability through the following general approach:
- Create an io_uring instance and register file descriptors with it
- Establish Unix domain socket connections and pass the registered file descriptors via SCM_RIGHTS
- Manipulate the socket state to trigger garbage collection
- Race the garbage collector against io_uring operations to cause the file structure to be freed while still referenced
- Leverage the Use-After-Free to corrupt kernel memory and escalate privileges
The exploitation requires precise timing to win the race condition. Technical details and proof-of-concept analysis are available in the Packet Storm Exploit Analysis.
Detection Methods for CVE-2022-2602
Indicators of Compromise
- Unexpected kernel crashes or panics, particularly those referencing io_uring or Unix socket garbage collection code paths
- Suspicious processes making unusual combinations of io_uring syscalls (io_uring_setup, io_uring_register) along with Unix domain socket operations
- Evidence of privilege escalation from unprivileged user accounts
- Kernel log messages indicating memory corruption or invalid memory access in io_uring related functions
Detection Strategies
- Monitor for processes creating io_uring instances in combination with heavy Unix socket file descriptor passing
- Deploy kernel runtime integrity monitoring to detect unexpected kernel memory modifications
- Implement system call auditing to track io_uring and socket-related activity from unprivileged users
- Use kernel address sanitizer (KASAN) in development/testing environments to detect Use-After-Free conditions
Monitoring Recommendations
- Enable kernel auditing subsystem to log io_uring operations and Unix socket communications
- Configure endpoint detection and response (EDR) solutions to monitor for known exploitation patterns
- Review kernel logs for signs of memory corruption or unexpected behavior in affected subsystems
- Implement real-time monitoring of privilege escalation attempts
How to Mitigate CVE-2022-2602
Immediate Actions Required
- Apply vendor-provided kernel security updates immediately on all affected systems
- If patches cannot be applied immediately, consider disabling io_uring through kernel parameters
- Audit systems for signs of compromise before and after patching
- Prioritize patching systems accessible to untrusted local users
Patch Information
Canonical has released multiple security updates addressing this vulnerability:
- Ubuntu Security Notice USN-5691-1
- Ubuntu Security Notice USN-5692-1
- Ubuntu Security Notice USN-5693-1
- Ubuntu Security Notice USN-5700-1
- Ubuntu Security Notice USN-5752-1
Additional technical details can be found in the CVE-2022-2602 Detail entry.
Workarounds
- Disable io_uring functionality if not required by applications on the system
- Restrict access to io_uring syscalls using seccomp filters for untrusted processes
- Implement additional sandboxing and isolation for processes from untrusted users
- Use container security profiles to block io_uring access in containerized workloads
# Disable io_uring at kernel level (requires kernel 5.19+ or backported sysctl)
# Note: This may impact application performance that relies on io_uring
echo 0 > /proc/sys/kernel/io_uring_disabled
# Alternative: Add to sysctl.conf for persistence
echo "kernel.io_uring_disabled = 1" >> /etc/sysctl.conf
sysctl -p
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


