CVE-2021-23133 Overview
A race condition vulnerability exists in the Linux kernel's SCTP (Stream Control Transmission Protocol) socket implementation, specifically in the net/sctp/socket.c file. This vulnerability affects Linux kernel versions before 5.12-rc8 and can lead to kernel privilege escalation from the context of a network service or an unprivileged process.
The flaw occurs when sctp_destroy_sock is called without holding the sock_net(sk)->sctp.addr_wq_lock lock, resulting in an element being removed from the auto_asconf_splist list without proper synchronization. This race condition can be exploited by an attacker with network service privileges to escalate to root, or directly from an unprivileged user context if a BPF_CGROUP_INET_SOCK_CREATE cgroup is attached that denies creation of certain SCTP sockets.
Critical Impact
Successful exploitation allows local attackers to escalate privileges to root, potentially gaining complete control over the affected system through kernel-level access.
Affected Products
- Linux Kernel (versions before 5.12-rc8)
- Fedora 32, 33, and 34
- Debian Linux 9.0
- NetApp Cloud Backup
- NetApp SolidFire & HCI Management Node
- Broadcom Brocade Fabric Operating System
- NetApp H-Series Storage Systems (H300S, H500S, H700S, H300E, H500E, H700E, H410S, H410C)
- NetApp SolidFire Baseboard Management Controller
Discovery Timeline
- April 22, 2021 - CVE-2021-23133 published to NVD
- November 21, 2024 - Last updated in NVD database
Technical Details for CVE-2021-23133
Vulnerability Analysis
This vulnerability is classified as CWE-362 (Race Condition), a type of concurrency flaw where the system's behavior depends on the timing of uncontrollable events. In this case, the race condition exists in the SCTP socket destruction path within the Linux kernel.
The vulnerability allows an attacker to exploit a Time-of-Check-Time-of-Use (TOCTOU) scenario in the kernel's SCTP subsystem. When SCTP sockets are destroyed, the kernel should hold the appropriate lock (addr_wq_lock) to ensure thread-safe removal of elements from the auto_asconf_splist linked list. However, due to missing lock acquisition, concurrent operations on this list can lead to memory corruption, use-after-free conditions, or other undefined behavior that can be leveraged for privilege escalation.
Root Cause
The root cause is improper synchronization in the sctp_destroy_sock function. When destroying an SCTP socket, the function fails to acquire the sock_net(sk)->sctp.addr_wq_lock before removing the socket from the auto_asconf_splist list. This missing lock allows concurrent access to the list, creating a race window that can be exploited.
The SCTP socket's automatic address configuration (auto_asconf) feature maintains a list of sockets that should receive updates when network addresses change. Without proper locking during socket destruction, the list structure can become corrupted when multiple threads attempt to modify it simultaneously.
Attack Vector
The attack requires local access to the system and leverages the following conditions:
Network Service Context: An attacker with access to a network service running with elevated privileges can trigger the race condition to escalate to root privileges.
Unprivileged User with BPF: Alternatively, if a BPF_CGROUP_INET_SOCK_CREATE program is attached that denies creation of certain SCTP sockets, an unprivileged user can directly exploit this vulnerability. The BPF program's denial creates a specific code path that exposes the race condition.
The attacker must carefully time the socket creation and destruction operations to win the race and corrupt kernel memory structures. This typically requires multiple attempts but is reliably achievable on multi-core systems.
Detection Methods for CVE-2021-23133
Indicators of Compromise
- Unusual SCTP socket activity with rapid creation and destruction patterns
- Kernel panic or crash logs referencing sctp_destroy_sock or auto_asconf_splist
- Unexpected privilege escalation events from network services or unprivileged processes
- Signs of BPF programs being loaded that interact with SCTP socket creation
Detection Strategies
- Monitor for kernel oops or panics involving SCTP subsystem functions in /var/log/kern.log or dmesg output
- Implement auditd rules to track SCTP socket operations and privilege changes
- Deploy kernel integrity monitoring to detect unauthorized kernel memory modifications
- Use SentinelOne's behavioral AI to identify suspicious privilege escalation patterns from network services
Monitoring Recommendations
- Enable SCTP-related kernel tracepoints for detailed socket lifecycle monitoring
- Configure alerting for processes that suddenly gain root privileges
- Monitor for unusual patterns of socket system calls, particularly rapid socket() and close() sequences for SCTP
- Track BPF program loading and attachment, especially those targeting INET socket creation
How to Mitigate CVE-2021-23133
Immediate Actions Required
- Update the Linux kernel to version 5.12-rc8 or later immediately
- Apply vendor-specific patches from distribution maintainers (Debian, Fedora, etc.)
- Restrict access to SCTP socket creation using seccomp filters or AppArmor/SELinux policies
- Limit BPF program loading capabilities to trusted administrators only
- Audit and monitor systems for signs of exploitation attempts
Patch Information
The vulnerability has been addressed in the official Linux kernel through commit b166a20b07382b8bc1dcee2a448715c9c2c81b5b. This fix ensures proper lock acquisition in sctp_destroy_sock before manipulating the auto_asconf_splist list.
Distribution-specific patches are available:
Workarounds
- Disable SCTP protocol entirely if not required: modprobe -r sctp and blacklist the module
- Use kernel lockdown mode to prevent loading of potentially vulnerable modules
- Implement strict cgroup controls to limit socket creation capabilities
- Deploy network segmentation to limit exposure of systems that require SCTP functionality
# Disable SCTP module if not required
echo "blacklist sctp" >> /etc/modprobe.d/blacklist-sctp.conf
modprobe -r sctp
# Verify SCTP is disabled
lsmod | grep sctp
# Check current kernel version
uname -r
# For systems requiring SCTP, apply kernel updates
# Debian/Ubuntu
apt update && apt upgrade linux-image-$(uname -r)
# RHEL/CentOS/Fedora
dnf update kernel
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


