CVE-2022-3566 Overview
CVE-2022-3566 is a race condition vulnerability in the Linux Kernel TCP Handler. The flaw affects the tcp_getsockopt and tcp_setsockopt functions, which manage socket options for TCP connections. Concurrent invocation of these functions can produce unsynchronized access to shared socket state, leading to memory corruption or inconsistent kernel state. The issue is tracked as VulDB entry VDB-211089 and is classified under [CWE-362] (Concurrent Execution using Shared Resource with Improper Synchronization).
Critical Impact
A local attacker on an adjacent network with low privileges can exploit the race condition to compromise confidentiality, integrity, and availability of an affected Linux system.
Affected Products
- Linux Kernel (mainline) prior to the patched commit f49cd2f4d6170d27a2c61f1fecb03d8a70c91f57
- Distributions shipping vulnerable kernels that have not backported the fix
- Systems exposing TCP socket option interfaces to local or adjacent network actors
Discovery Timeline
- 2022-10-17 - CVE-2022-3566 published to NVD
- 2024-11-21 - Last updated in NVD database
Technical Details for CVE-2022-3566
Vulnerability Analysis
The vulnerability resides in the TCP socket option handlers tcp_getsockopt and tcp_setsockopt within the Linux kernel networking stack. Both functions read from and write to shared struct sock and struct tcp_sock fields that govern a TCP endpoint's configuration. When invoked concurrently against the same socket from multiple threads or contexts, the functions execute without sufficient locking on certain option paths. This produces a race window in which one execution path observes or mutates state that another path is simultaneously modifying.
Exploitation requires access from an adjacent network, low privileges, and no user interaction, but carries high attack complexity. Successful exploitation can compromise data confidentiality through information disclosure, modify socket state to alter session behavior, and crash the kernel resulting in denial of service.
Root Cause
The root cause is improper synchronization of shared socket state between tcp_getsockopt and tcp_setsockopt code paths. The implementation did not consistently hold the socket lock across all option read and write sequences. This is a classic [CWE-362] race condition where two threads interleave operations on shared data without atomic guarantees.
Attack Vector
An attacker with access to a local user account or an adjacent network position can issue rapid, concurrent getsockopt and setsockopt system calls targeting the same TCP socket. By winning the race window, the attacker can trigger inconsistent state transitions in kernel memory. The high attack complexity reflects the timing precision required to consistently win the race. The fix is recorded in the upstream commit referenced in the Linux Kernel Commit Update.
Detection Methods for CVE-2022-3566
Indicators of Compromise
- Unexpected kernel oops or panic messages referencing tcp_getsockopt, tcp_setsockopt, or the TCP socket option path in dmesg and /var/log/kern.log
- Anomalous TCP socket behavior such as corrupted option values, unexplained connection resets, or inconsistent socket states observed in ss -tinfo
- Local processes performing high-frequency, concurrent setsockopt/getsockopt calls against the same file descriptor from multiple threads
Detection Strategies
- Monitor kernel ring buffer output for warnings, BUG_ON triggers, or stack traces involving the TCP option handlers
- Audit setsockopt and getsockopt syscalls using auditd or eBPF tracing to identify abnormal concurrency patterns from unprivileged users
- Compare running kernel version against distribution advisories to confirm whether the upstream commit f49cd2f4d6170d27a2c61f1fecb03d8a70c91f57 has been backported
Monitoring Recommendations
- Enable kernel crash collection (kdump) to capture forensic data if the race triggers a panic
- Forward kernel logs and audit events to a centralized log platform for correlation across hosts
- Track host kernel inventory and patch state continuously to identify drift from patched baselines
How to Mitigate CVE-2022-3566
Immediate Actions Required
- Apply the upstream Linux kernel patch identified by commit f49cd2f4d6170d27a2c61f1fecb03d8a70c91f57 or the equivalent backport from your distribution vendor
- Identify all Linux hosts in inventory and prioritize patching for systems exposed to multi-tenant or adjacent-network workloads
- Reboot patched systems to load the fixed kernel image, since live-patching frameworks may not cover this change on every distribution
Patch Information
The fix is committed upstream in the stable Linux kernel tree. Refer to the Linux Kernel Commit Update for the source change. Additional technical context is available in VulDB #211089. Consult your distribution's security tracker for the specific kernel package version that includes the backport.
Workarounds
- Restrict local and adjacent-network access to systems running unpatched kernels using network segmentation and firewall policies
- Limit untrusted user execution on multi-tenant Linux hosts where attackers could trigger concurrent socket option calls
- Enforce least-privilege access controls and disable unnecessary local accounts on exposed servers
# Verify running kernel version and check for patch presence
uname -r
# On Debian/Ubuntu, update kernel package
sudo apt update && sudo apt install --only-upgrade linux-image-$(uname -r | sed 's/-generic//')
# On RHEL/CentOS, update kernel package
sudo dnf update kernel
# Reboot to load the patched kernel
sudo reboot
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.