Skip to content
OpenAdvisories
Unscored CVE-2021-4442 EUVD-2021-34641GHSA-f9pf-68jx-89j3

tcp: add sanity tests to TCP_QUEUE_SEQ

Published Aug 29, 2024 · Updated May 11, 2026 · Assigned by Linux

Vendor: Linux Product: Linux Package: linux Package: linux Package: linux-allwinner-5.19 Package: linux-aws Package: linux-aws-5.0 Package: linux-aws-5.11 Package: linux-aws-5.13 Package: linux-aws-5.19 Package: linux-aws-5.3 Package: linux-aws-5.4 Package: linux-aws-5.8 Package: linux-aws-6.2 Package: linux-aws-6.5 Package: linux-aws-fips Package: linux-aws-hwe Package: linux-azure Package: linux-azure-4.15 Package: linux-azure-5.11 Package: linux-azure-5.13 Package: linux-azure-5.19 Package: linux-azure-5.3 Package: linux-azure-5.4 Package: linux-azure-5.8 Package: linux-azure-6.2 Package: linux-azure-6.5 Package: linux-azure-edge Package: linux-azure-fde Package: linux-azure-fde-5.19 Package: linux-azure-fde-6.2 Package: linux-azure-fips Package: linux-fips Package: linux-gcp Package: linux-gcp-4.15 Package: linux-gcp-5.11 Package: linux-gcp-5.13 Package: linux-gcp-5.19 Package: linux-gcp-5.3 Package: linux-gcp-5.4 Package: linux-gcp-5.8 Package: linux-gcp-6.2 Package: linux-gcp-6.5 Package: linux-gcp-fips Package: linux-gke Package: linux-gke-4.15 Package: linux-gke-5.15 Package: linux-gke-5.4 Package: linux-gkeop Package: linux-gkeop-5.4 Package: linux-hwe Package: linux-hwe-5.11 Package: linux-hwe-5.13 Package: linux-hwe-5.19 Package: linux-hwe-5.4 Package: linux-hwe-5.8 Package: linux-hwe-6.2 Package: linux-hwe-6.5 Package: linux-hwe-edge Package: linux-intel-5.13 Package: linux-intel-iot-realtime Package: linux-kvm Package: linux-lowlatency-hwe-5.19 Package: linux-lowlatency-hwe-6.2 Package: linux-lowlatency-hwe-6.5 Package: linux-lts-xenial Package: linux-nvidia-6.2 Package: linux-oem Package: linux-oem-5.10 Package: linux-oem-5.13 Package: linux-oem-5.14 Package: linux-oem-5.17 Package: linux-oem-5.6 Package: linux-oem-6.0 Package: linux-oem-6.1 Package: linux-oem-6.5 Package: linux-oracle Package: linux-oracle-5.0 Package: linux-oracle-5.11 Package: linux-oracle-5.13 Package: linux-oracle-5.3 Package: linux-oracle-5.4 Package: linux-oracle-5.8 Package: linux-oracle-6.5 Package: linux-raspi Package: linux-raspi-5.4 Package: linux-raspi-realtime Package: linux-raspi2 Package: linux-realtime Package: linux-riscv Package: linux-riscv-5.11 Package: linux-riscv-5.19 Package: linux-riscv-5.8 Package: linux-riscv-6.5 Package: linux-starfive-5.19 Package: linux-starfive-6.2 Package: linux-starfive-6.5 Package: linux-vmware Platform: Linux Ecosystem: Debian Ecosystem: Ubuntu

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.

Affected products

VendorProductAffectedFixed
Linux Linux 3.5 4.19.181

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 linux 5.10.24-1 —
Debian 13 linux 5.10.24-1 —
Debian 12 linux 5.10.24-1 —
ReleasePackageFixed inAdvisory
Ubuntu 24.04 LTS linux-raspi-realtime No fix yet —
Ubuntu 22.04 LTS linux-riscv +31 No fix yet —
Ubuntu 20.04 LTS linux 5.4.0-73.82 —
Ubuntu 20.04 LTS linux-aws 5.4.0-1048.50 —
Ubuntu 20.04 LTS linux-azure 5.4.0-1047.49 —
Ubuntu 20.04 LTS linux-gcp 5.4.0-1043.46 —
Ubuntu 20.04 LTS linux-gke +26 No fix yet —
Ubuntu 20.04 LTS linux-gkeop 5.4.0-1015.16 —
Ubuntu 20.04 LTS linux-kvm 5.4.0-1039.40 —
Ubuntu 20.04 LTS linux-oracle 5.4.0-1045.49 —
Ubuntu 20.04 LTS linux-raspi 5.4.0-1035.38 —
Ubuntu 18.04 LTS linux 4.15.0-144.148 —
Ubuntu 18.04 LTS linux-aws 4.15.0-1103.110 —
Ubuntu 18.04 LTS linux-aws-5.4 5.4.0-1048.50~18.04.1 —
Ubuntu 18.04 LTS linux-azure-4.15 4.15.0-1115.128 —
Ubuntu 18.04 LTS linux-azure-5.4 5.4.0-1047.49~18.04.1 —
Ubuntu 18.04 LTS linux-gcp +14 No fix yet —
Ubuntu 18.04 LTS linux-gcp-4.15 4.15.0-1100.113 —
Ubuntu 18.04 LTS linux-gcp-5.4 5.4.0-1043.46~18.04.1 —
Ubuntu 18.04 LTS linux-hwe-5.4 5.4.0-73.82~18.04.1 —
Ubuntu 18.04 LTS linux-kvm 4.15.0-1092.94 —
Ubuntu 18.04 LTS linux-oracle 4.15.0-1072.80 —
Ubuntu 18.04 LTS linux-oracle-5.4 5.4.0-1044.47~18.04.1 —
Ubuntu 18.04 LTS linux-raspi-5.4 5.4.0-1035.38~18.04.1 —
Ubuntu 16.04 LTS linux-hwe-edge No fix yet —
Show 8 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro FIPS 20.04 LTS linux-fips +3 No fix yet —
Ubuntu Pro FIPS 18.04 LTS linux-fips +3 No fix yet —
Ubuntu Pro FIPS 16.04 LTS linux-fips No fix yet —
Ubuntu Pro FIPS-updates 20.04 LTS linux-aws-fips 5.4.0-1069.73+fips2 —
Ubuntu Pro FIPS-updates 20.04 LTS linux-azure-fips 5.4.0-1073.76+fips1 —
Ubuntu Pro FIPS-updates 20.04 LTS linux-gcp-fips 5.4.0-1067.71~20.04.1 —
Ubuntu Pro FIPS-updates 18.04 LTS linux-aws-fips 4.15.0-2045.47 —
Ubuntu Pro FIPS-updates 18.04 LTS linux-azure-fips 4.15.0-2027.30 —
Ubuntu Pro FIPS-updates 18.04 LTS linux-fips 4.15.0-1060.68 —
Ubuntu Pro FIPS-updates 16.04 LTS linux-fips No fix yet —
Ubuntu Pro 16.04 LTS linux +2 No fix yet —
Ubuntu Pro 16.04 LTS linux-aws-hwe 4.15.0-1103.110~16.04.1 —
Ubuntu Pro 16.04 LTS linux-azure 4.15.0-1115.128~16.04.1 —
Ubuntu Pro 16.04 LTS linux-gcp 4.15.0-1100.113~16.04.1 —
Ubuntu Pro 16.04 LTS linux-hwe 4.15.0-144.148~16.04.1 —
Ubuntu Pro 16.04 LTS linux-oracle 4.15.0-1072.80~16.04.1 —
Ubuntu Pro 14.04 LTS linux +2 No fix yet —
Ubuntu Pro 14.04 LTS linux-azure 4.15.0-1115.128~14.04.1 —
ReleasePackageFixed inAdvisory
RHEL 8 perf +26 4.18.0-348.el8 RHSA-2021:4356
ReleasePackageFixed inAdvisory
SLE Real Time 12 SP5 kernel-rt +3 4.12.14-10.203.1 SUSE-SU-2024:3566-1

Advisories 3

References