Cloudanix VulnDB

CVE-2021-4442

Medium · 5.5

CVSS

5.5

EPSS

0.4%

Published

Aug 29, 2024

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A networking flaw lets someone with local access mess up how data order is tracked on connections, which can break those connections or create system alerts.

Exploitation
Local Privilege
Attacker needs
Local User
Complexity
Moderate
Impact
Denial Of Service
Component
OS kernel
Class
Improper Input Validation
Remediation
Patch
Effort
Medium
Patch risk
Low

What it actually does

The flaw permits TCP_QUEUE_SEQ socket option to alter receive sequence numbers after data has been restored to a non-empty receive queue, bypassing intended sanity checks and causing sequence mismatches that trigger kernel warnings or connection resets.

Why it matters to the business

Local attackers can induce TCP connection failures or kernel warnings on affected systems, resulting in service disruption for network-dependent applications with minimal attacker effort.

How an attack unfolds

An attacker creates a TCP socket, enables repair mode and queue selection via setsockopt, populates the receive queue with data, disables repair mode, then issues TCP_QUEUE_SEQ with an out-of-sync value; subsequent recv operations expose the inconsistency leading to ECONNRESET or warnings.

How to fix it

Apply kernel patches adding empty-queue validation to TCP_QUEUE_SEQ on both rx and tx paths; upgrade to releases containing the fix for the reported TCP sequence handling issue.

How to confirm the fix worked

Confirm presence of sanity checks in tcp_recvmsg_locked and equivalent tx path functions; test that TCP_QUEUE_SEQ calls on non-empty queues are rejected or ignored.

Typical attack path

  1. Create AF_INET6 SOCK_STREAM socket
  2. Enable TCP_REPAIR via setsockopt
  3. Select TCP_REPAIR_QUEUE
  4. Send data to populate receive queue
  5. Disable TCP_REPAIR
  6. Set TCP_QUEUE_SEQ to invalid value
  7. Perform recvfrom to trigger mismatch handling

How to detect it

Review system logs for messages containing 'TCP recvmsg seq # bug' or 'WARNING.*tcp_recvmsg_locked'; inspect audit logs for unusual setsockopt calls involving SOL_TCP and TCP_QUEUE_SEQ.

What your security team should do

  • Prioritize kernel updates on all Linux hosts handling TCP traffic
  • Monitor for TCP sequence warning logs in syslog
  • Restrict unprivileged use of TCP_REPAIR socket options where possible

The record

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.

Affected packages

Ecosystem Package Introduced Fixed
Debian:11 linux 0 5.10.24-1
Debian:12 linux 0 5.10.24-1
Debian:13 linux 0 5.10.24-1
Red Hat:enterprise_linux:8::baseos bpftool 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos bpftool-debuginfo 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-abi-stablelists 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-core 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-cross-headers 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-debug 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-debug-core 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-debug-debuginfo 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-debug-devel 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-debug-modules 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-debug-modules-extra 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-debuginfo 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-debuginfo-common-aarch64 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-debuginfo-common-ppc64le 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-debuginfo-common-s390x 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-debuginfo-common-x86_64 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-devel 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-doc 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-headers 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-modules 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-modules-extra 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-tools 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-tools-debuginfo 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-tools-libs 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-tools-libs-devel 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-zfcpdump 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-zfcpdump-core 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-zfcpdump-debuginfo 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-zfcpdump-devel 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-zfcpdump-modules 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos kernel-zfcpdump-modules-extra 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos perf 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos perf-debuginfo 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos python3-perf 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::baseos python3-perf-debuginfo 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb bpftool 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb bpftool-debuginfo 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-abi-stablelists 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-core 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-cross-headers 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-debug 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-debug-core 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-debug-debuginfo 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-debug-devel 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-debug-modules 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-debug-modules-extra 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-debuginfo 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-debuginfo-common-aarch64 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-debuginfo-common-ppc64le 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-debuginfo-common-s390x 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-debuginfo-common-x86_64 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-devel 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-doc 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-headers 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-modules 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-modules-extra 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-tools 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-tools-debuginfo 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-tools-libs 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-tools-libs-devel 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-zfcpdump 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-zfcpdump-core 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-zfcpdump-debuginfo 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-zfcpdump-devel 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-zfcpdump-modules 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb kernel-zfcpdump-modules-extra 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb perf 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb perf-debuginfo 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb python3-perf 0 0:4.18.0-348.el8
Red Hat:enterprise_linux:8::crb python3-perf-debuginfo 0 0:4.18.0-348.el8
SUSE:Linux Enterprise Real Time 12 SP5 kernel-rt 0 4.12.14-10.203.1
SUSE:Linux Enterprise Real Time 12 SP5 kernel-rt_debug 0 4.12.14-10.203.1
SUSE:Linux Enterprise Real Time 12 SP5 kernel-source-rt 0 4.12.14-10.203.1
SUSE:Linux Enterprise Real Time 12 SP5 kernel-syms-rt 0 4.12.14-10.203.1
Ubuntu:16.04:LTS linux-hwe-edge 0 No fix
Ubuntu:18.04:LTS linux 0 4.15.0-144.148
Ubuntu:18.04:LTS linux-aws 0 4.15.0-1103.110
Ubuntu:18.04:LTS linux-aws-5.0 0 No fix
Ubuntu:18.04:LTS linux-aws-5.3 0 No fix
Ubuntu:18.04:LTS linux-aws-5.4 0 5.4.0-1048.50~18.04.1
Ubuntu:18.04:LTS linux-azure 0 No fix
Ubuntu:18.04:LTS linux-azure-4.15 0 4.15.0-1115.128
Ubuntu:18.04:LTS linux-azure-5.3 0 No fix
Ubuntu:18.04:LTS linux-azure-5.4 0 5.4.0-1047.49~18.04.1
Ubuntu:18.04:LTS linux-azure-edge 0 No fix
Ubuntu:18.04:LTS linux-gcp 0 No fix
Ubuntu:18.04:LTS linux-gcp-4.15 0 4.15.0-1100.113
Ubuntu:18.04:LTS linux-gcp-5.3 0 No fix
Ubuntu:18.04:LTS linux-gcp-5.4 0 5.4.0-1043.46~18.04.1
Ubuntu:18.04:LTS linux-gke-4.15 0 No fix
Ubuntu:18.04:LTS linux-gke-5.4 0 No fix
Ubuntu:18.04:LTS linux-gkeop-5.4 0 No fix
Ubuntu:18.04:LTS linux-hwe 0 No fix
Ubuntu:18.04:LTS linux-hwe-5.4 0 5.4.0-73.82~18.04.1
Ubuntu:18.04:LTS linux-hwe-edge 0 No fix
Ubuntu:18.04:LTS linux-ibm-5.4 0 5.4.0-1010.11~18.04.2
Ubuntu:18.04:LTS linux-kvm 0 4.15.0-1092.94
Ubuntu:18.04:LTS linux-oem 0 No fix
Ubuntu:18.04:LTS linux-oracle 0 4.15.0-1072.80
Ubuntu:18.04:LTS linux-oracle-5.0 0 No fix
Ubuntu:18.04:LTS linux-oracle-5.3 0 No fix
Ubuntu:18.04:LTS linux-oracle-5.4 0 5.4.0-1044.47~18.04.1
Ubuntu:18.04:LTS linux-raspi-5.4 0 5.4.0-1035.38~18.04.1
Ubuntu:20.04:LTS linux 0 5.4.0-73.82
Ubuntu:20.04:LTS linux-aws 0 5.4.0-1048.50
Ubuntu:20.04:LTS linux-aws-5.11 0 No fix
Ubuntu:20.04:LTS linux-aws-5.13 0 No fix
Ubuntu:20.04:LTS linux-aws-5.15 0 5.15.0-1014.18~20.04.1
Ubuntu:20.04:LTS linux-aws-5.8 0 No fix
Ubuntu:20.04:LTS linux-azure 0 5.4.0-1047.49
Ubuntu:20.04:LTS linux-azure-5.11 0 No fix
Ubuntu:20.04:LTS linux-azure-5.13 0 No fix
Ubuntu:20.04:LTS linux-azure-5.15 0 5.15.0-1007.8~20.04.1
Ubuntu:20.04:LTS linux-azure-5.8 0 No fix
Ubuntu:20.04:LTS linux-azure-fde 0 No fix
Ubuntu:20.04:LTS linux-azure-fde-5.15 0 5.15.0-1019.24~20.04.1.1
Ubuntu:20.04:LTS linux-bluefield 0 5.4.0-1011.14
Ubuntu:20.04:LTS linux-gcp 0 5.4.0-1043.46
Ubuntu:20.04:LTS linux-gcp-5.11 0 No fix
Ubuntu:20.04:LTS linux-gcp-5.13 0 No fix
Ubuntu:20.04:LTS linux-gcp-5.15 0 5.15.0-1006.9~20.04.1
Ubuntu:20.04:LTS linux-gcp-5.8 0 No fix
Ubuntu:20.04:LTS linux-gke 0 No fix
Ubuntu:20.04:LTS linux-gke-5.15 0 No fix
Ubuntu:20.04:LTS linux-gkeop 0 5.4.0-1015.16
Ubuntu:20.04:LTS linux-gkeop-5.15 0 5.15.0-1003.5~20.04.2
Ubuntu:20.04:LTS linux-hwe-5.11 0 No fix
Ubuntu:20.04:LTS linux-hwe-5.13 0 No fix
Ubuntu:20.04:LTS linux-hwe-5.15 0 5.15.0-33.34~20.04.1
Ubuntu:20.04:LTS linux-hwe-5.8 0 No fix
Ubuntu:20.04:LTS linux-ibm 0 5.4.0-1003.4
Ubuntu:20.04:LTS linux-ibm-5.15 0 5.15.0-1033.36~20.04.1
Ubuntu:20.04:LTS linux-intel-5.13 0 No fix
Ubuntu:20.04:LTS linux-intel-iotg-5.15 0 5.15.0-1003.5~20.04.1
Ubuntu:20.04:LTS linux-iot 0 5.4.0-1001.3
Ubuntu:20.04:LTS linux-kvm 0 5.4.0-1039.40
Ubuntu:20.04:LTS linux-lowlatency-hwe-5.15 0 5.15.0-33.34~20.04.1
Ubuntu:20.04:LTS linux-oem-5.10 0 No fix
Ubuntu:20.04:LTS linux-oem-5.13 0 No fix
Ubuntu:20.04:LTS linux-oem-5.14 0 No fix
Ubuntu:20.04:LTS linux-oem-5.6 0 No fix
Ubuntu:20.04:LTS linux-oracle 0 5.4.0-1045.49
Ubuntu:20.04:LTS linux-oracle-5.11 0 No fix
Ubuntu:20.04:LTS linux-oracle-5.13 0 No fix
Ubuntu:20.04:LTS linux-oracle-5.15 0 5.15.0-1007.9~20.04.1
Ubuntu:20.04:LTS linux-oracle-5.8 0 No fix
Ubuntu:20.04:LTS linux-raspi 0 5.4.0-1035.38
Ubuntu:20.04:LTS linux-raspi2 0 No fix
Ubuntu:20.04:LTS linux-riscv 0 No fix
Ubuntu:20.04:LTS linux-riscv-5.11 0 No fix
Ubuntu:20.04:LTS linux-riscv-5.15 0 5.15.0-1015.17~20.04.1
Ubuntu:20.04:LTS linux-riscv-5.8 0 No fix
Ubuntu:20.04:LTS linux-xilinx-zynqmp 0 5.4.0-1020.24
Ubuntu:22.04:LTS linux 0 5.13.0-19.19
Ubuntu:22.04:LTS linux-allwinner-5.19 0 No fix
Ubuntu:22.04:LTS linux-aws 0 5.13.0-1005.6
Ubuntu:22.04:LTS linux-aws-5.19 0 No fix
Ubuntu:22.04:LTS linux-aws-6.2 0 No fix
Ubuntu:22.04:LTS linux-aws-6.5 0 No fix
Ubuntu:22.04:LTS linux-aws-6.8 0 6.8.0-1009.9~22.04.2
Ubuntu:22.04:LTS linux-azure 0 5.13.0-1006.7
Ubuntu:22.04:LTS linux-azure-5.19 0 No fix
Ubuntu:22.04:LTS linux-azure-6.2 0 No fix
Ubuntu:22.04:LTS linux-azure-6.5 0 No fix
Ubuntu:22.04:LTS linux-azure-6.8 0 6.8.0-1008.8~22.04.1
Ubuntu:22.04:LTS linux-azure-fde 0 5.15.0-1019.24.1
Ubuntu:22.04:LTS linux-azure-fde-5.19 0 No fix
Ubuntu:22.04:LTS linux-azure-fde-6.2 0 No fix
Ubuntu:22.04:LTS linux-gcp 0 5.13.0-1005.6
Ubuntu:22.04:LTS linux-gcp-5.19 0 No fix
Ubuntu:22.04:LTS linux-gcp-6.2 0 No fix
Ubuntu:22.04:LTS linux-gcp-6.5 0 No fix
Ubuntu:22.04:LTS linux-gcp-6.8 0 6.8.0-1010.11~22.04.1
Ubuntu:22.04:LTS linux-gke 0 5.15.0-1002.2
Ubuntu:22.04:LTS linux-gkeop 0 5.15.0-1001.2
Ubuntu:22.04:LTS linux-hwe-5.19 0 No fix
Ubuntu:22.04:LTS linux-hwe-6.2 0 No fix
Ubuntu:22.04:LTS linux-hwe-6.5 0 No fix
Ubuntu:22.04:LTS linux-hwe-6.8 0 6.8.0-38.38~22.04.1
Ubuntu:22.04:LTS linux-ibm 0 5.15.0-1002.2
Ubuntu:22.04:LTS linux-intel-iot-realtime 0 No fix
Ubuntu:22.04:LTS linux-intel-iot-realtime 0 5.15.0-1021.26
Ubuntu:22.04:LTS linux-intel-iotg 0 5.15.0-1004.6
Ubuntu:22.04:LTS linux-kvm 0 5.13.0-1004.4
Ubuntu:22.04:LTS linux-lowlatency 0 5.15.0-22.22
Ubuntu:22.04:LTS linux-lowlatency-hwe-5.19 0 No fix
Ubuntu:22.04:LTS linux-lowlatency-hwe-6.2 0 No fix
Ubuntu:22.04:LTS linux-lowlatency-hwe-6.5 0 No fix
Ubuntu:22.04:LTS linux-lowlatency-hwe-6.8 0 6.8.0-38.38.1~22.04.2
Ubuntu:22.04:LTS linux-nvidia 0 5.15.0-1005.5
Ubuntu:22.04:LTS linux-nvidia-6.2 0 No fix
Ubuntu:22.04:LTS linux-nvidia-6.5 0 6.5.0-1004.4
Ubuntu:22.04:LTS linux-nvidia-6.8 0 6.8.0-1008.8~22.04.1
Ubuntu:22.04:LTS linux-oem-5.17 0 No fix
Ubuntu:22.04:LTS linux-oem-6.0 0 No fix

Related vulnerabilities