Skip to main content

CVE-2021-4442: Vulnerability in Linux Linux

High
VulnerabilityCVE-2021-4442cvecve-2021-4442
Published: Thu Aug 29 2024 (08/29/2024, 09:05:37 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: tcp: add sanity tests to TCP_QUEUE_SEQ Qingyu Li reported a syzkaller bug where the repro changes RCV SEQ _after_ restoring data in the receive queue. mprotect(0x4aa000, 12288, PROT_READ) = 0 mmap(0x1ffff000, 4096, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1ffff000 mmap(0x20000000, 16777216, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x20000000 mmap(0x21000000, 4096, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x21000000 socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 3 setsockopt(3, SOL_TCP, TCP_REPAIR, [1], 4) = 0 connect(3, {sa_family=AF_INET6, sin6_port=htons(0), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_scope_id=0}, 28) = 0 setsockopt(3, SOL_TCP, TCP_REPAIR_QUEUE, [1], 4) = 0 sendmsg(3, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="0x0000000000000003\0\0", iov_len=20}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 20 setsockopt(3, SOL_TCP, TCP_REPAIR, [0], 4) = 0 setsockopt(3, SOL_TCP, TCP_QUEUE_SEQ, [128], 4) = 0 recvfrom(3, NULL, 20, 0, NULL, NULL) = -1 ECONNRESET (Connection reset by peer) syslog shows: [ 111.205099] TCP recvmsg seq # bug 2: copied 80, seq 0, rcvnxt 80, fl 0 [ 111.207894] WARNING: CPU: 1 PID: 356 at net/ipv4/tcp.c:2343 tcp_recvmsg_locked+0x90e/0x29a0 This should not be allowed. TCP_QUEUE_SEQ should only be used when queues are empty. This patch fixes this case, and the tx path as well.

AI-Powered Analysis

AILast updated: 06/26/2025, 09:22:53 UTC

Technical Analysis

CVE-2021-4442 is a vulnerability identified in the Linux kernel's TCP networking stack, specifically related to the handling of the TCP_QUEUE_SEQ socket option. The vulnerability arises from improper sanity checks in the TCP_QUEUE_SEQ implementation, which is used to manipulate TCP queue sequence numbers during TCP repair operations. The issue was reported by Qingyu Li via syzkaller, a kernel fuzzing tool, highlighting a bug where the receive sequence number (RCV SEQ) is modified after data has already been restored in the receive queue. This violates expected TCP queue state assumptions. The vulnerability manifests when TCP_QUEUE_SEQ is used while the TCP queues are not empty, which should not be allowed. The kernel logs show warnings and errors such as "TCP recvmsg seq # bug" and kernel warnings in tcp_recvmsg_locked, indicating inconsistent TCP queue states. The patch fixes the problem by enforcing that TCP_QUEUE_SEQ can only be used when the queues are empty, preventing state corruption on both receive and transmit paths. This vulnerability affects multiple versions of the Linux kernel identified by specific commit hashes. Although no known exploits are reported in the wild, the vulnerability could potentially be exploited by an attacker with local or network access to manipulate TCP connections at a low level, possibly leading to denial of service or other unintended TCP behavior. The vulnerability does not have a CVSS score assigned yet, but it is a kernel-level flaw affecting core TCP networking functionality.

Potential Impact

For European organizations, the impact of CVE-2021-4442 could be significant given the widespread use of Linux in servers, cloud infrastructure, and network devices. Exploitation could allow attackers to disrupt TCP connections by corrupting TCP queue states, potentially causing denial of service conditions on critical network services. This could affect web servers, application servers, and any service relying on stable TCP connections. In environments with high network traffic or where TCP repair features are used (e.g., in advanced network debugging or failover scenarios), the vulnerability could be leveraged to cause instability or crashes. Although exploitation requires specific conditions and likely some level of access, the kernel-level nature means that successful exploitation could impact confidentiality, integrity, and availability of network communications. This is particularly concerning for sectors such as finance, telecommunications, and critical infrastructure in Europe, where Linux-based systems are prevalent and network reliability is paramount.

Mitigation Recommendations

To mitigate CVE-2021-4442, European organizations should: 1) Apply the official Linux kernel patches that enforce proper sanity checks on TCP_QUEUE_SEQ usage as soon as they become available from trusted Linux distributions or kernel maintainers. 2) Monitor kernel updates and subscribe to security advisories from Linux vendors and the CVE database to ensure timely patching. 3) Restrict access to systems and services that allow manipulation of TCP repair options to trusted administrators only, minimizing the risk of unauthorized exploitation. 4) Implement network segmentation and firewall rules to limit exposure of vulnerable Linux hosts to untrusted networks. 5) Use kernel hardening and security modules (e.g., SELinux, AppArmor) to restrict capabilities that could be used to exploit kernel vulnerabilities. 6) Conduct regular security audits and penetration testing focusing on network stack vulnerabilities and TCP repair features. 7) In environments where TCP repair is used for debugging or failover, review and limit its usage to reduce attack surface. These steps go beyond generic advice by focusing on controlling access to TCP repair features and ensuring rapid deployment of kernel patches.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-08-29T09:00:39.580Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9836c4522896dcbea811

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

Last enriched: 6/26/2025, 9:22:53 AM

Last updated: 8/13/2025, 5:37:07 AM

Views: 21

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