In the Linux kernel, the following vulnerability has been resolved:
tcp_bpf: Fix the sk_mem_uncharge logic in tcp_bpf_sendmsg
The current sk memory accounting logic in __SK_REDIRECT is pre-uncharging tosend bytes, which is either msg->sg.size or a smaller value apply_bytes.
Potential problems with this strategy are as follows:
- If the actual sent bytes are smaller than tosend, we need to charge some bytes back, as in line 487, which is okay but seems not clean.
- When tosend is set to apply_bytes, as in line 417, and (ret < 0), we may miss uncharging (msg->sg.size - apply_bytes) bytes.
[...] 415 tosend = msg->sg.size; 416 if (psock->apply_bytes && psock->apply_bytes < tosend) 417 tosend = psock->apply_bytes; [...] 443 sk_msg_return(sk, msg, tosend); 444 release_sock(sk); 446 origsize = msg->sg.size; 447 ret = tcp_bpf_sendmsg_redir(sk_redir, redir_ingress, 448 msg, tosend, flags); 449 sent = origsize - msg->sg.size; [...] 454 lock_sock(sk); 455 if (unlikely(ret < 0)) { 456 int free = sk_msg_free_nocharge(sk, msg); 458 if (!cork) 459 *copied -= free; 460 } [...] 487 if (eval == __SK_REDIRECT) 488 sk_mem_charge(sk, tosend - sent); [...]
When running the selftest test_txmsg_redir_wait_sndmem with txmsg_apply, the following warning will be reported:
------------[ cut here ]------------ WARNING: CPU: 6 PID: 57 at net/ipv4/af_inet.c:156 inet_sock_destruct+0x190/0x1a0 Modules linked in: CPU: 6 UID: 0 PID: 57 Comm: kworker/6:0 Not tainted 6.12.0-rc1.bm.1-amd64+ #43 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Workqueue: events sk_psock_destroy RIP: 0010:inet_sock_destruct+0x190/0x1a0 RSP: 0018:ffffad0a8021fe08 EFLAGS: 00010206 RAX: 0000000000000011 RBX: ffff9aab4475b900 RCX: ffff9aab481a0800 RDX: 0000000000000303 RSI: 0000000000000011 RDI: ffff9aab4475b900 RBP: ffff9aab4475b990 R08: 0000000000000000 R09: ffff9aab40050ec0 R10: 0000000000000000 R11: ffff9aae6fdb1d01 R12: ffff9aab49c60400 R13: ffff9aab49c60598 R14: ffff9aab49c60598 R15: dead000000000100 FS: 0000000000000000(0000) GS:ffff9aae6fd80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffec7e47bd8 CR3: 00000001a1a1c004 CR4: 0000000000770ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: <TASK> ? __warn+0x89/0x130 ? inet_sock_destruct+0x190/0x1a0 ? report_bug+0xfc/0x1e0 ? handle_bug+0x5c/0xa0 ? exc_invalid_op+0x17/0x70 ? asm_exc_invalid_op+0x1a/0x20 ? inet_sock_destruct+0x190/0x1a0 __sk_destruct+0x25/0x220 sk_psock_destroy+0x2b2/0x310 process_scheduled_works+0xa3/0x3e0 worker_thread+0x117/0x240 ? __pfx_worker_thread+0x10/0x10 kthread+0xcf/0x100 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x31/0x40 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1a/0x30 </TASK> ---[ end trace 0000000000000000 ]---
In __SK_REDIRECT, a more concise way is delaying the uncharging after sent bytes are finalized, and uncharge this value. When (ret < 0), we shall invoke sk_msg_free.
Same thing happens in case __SK_DROP, when tosend is set to apply_bytes, we may miss uncharging (msg->sg.size - apply_bytes) bytes. The same warning will be reported in selftest.
[...] 468 case __SK_DROP: 469 default: 470 sk_msg_free_partial(sk, msg, tosend); 471 sk_msg_apply_bytes(psock, tosend); 472 *copied -= (tosend + delta); 473 return -EACCES; [...]
So instead of sk_msg_free_partial we can do sk_msg_free here.
CVSS Details
- CVSS 3.1 Base Score: 7.8
- CVSS 3.1 Vector: (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)
Covered by Rapid7
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Amazon Linux Ami 2 | — | Upgrade kernel-toolsUpgrade kernel-tools-develUpgrade perfUpgrade kernel-develUpgrade kernel-tools-debuginfoUpgrade kernel-livepatch-5.10.233-223.887Upgrade kernel-debuginfo-common-aarch64Upgrade kernel-livepatch-5.15.176-118.170Upgrade bpftoolUpgrade python-perfUpgrade kernel-debuginfoUpgrade perf-debuginfoUpgrade python-perf-debuginfoUpgrade kernel-debuginfo-common-x86_64Upgrade bpftool-debuginfoUpgrade kernel-headersUpgrade kernel | Mar 14, 2025 | Dec 27, 2024 |
| Amazon_linux_2023 | — | Upgrade kernel-livepatch-6.1.124-134.200Upgrade bpftool-debuginfoUpgrade kernel-toolsUpgrade kernel-debuginfo-common-x86_64Upgrade kernel-modules-extra-commonUpgrade kernel-headersUpgrade perf-debuginfoUpgrade kernel-libbpf-staticUpgrade bpftoolUpgrade kernel-tools-debuginfoUpgrade kernel-libbpfUpgrade kernel-develUpgrade kernel-debuginfoUpgrade kernelUpgrade python3-perfUpgrade kernel-modules-extraUpgrade python3-perf-debuginfoUpgrade kernel-debuginfo-common-aarch64Upgrade kernel-tools-develUpgrade kernel-libbpf-develUpgrade perf | Mar 27, 2025 | Dec 27, 2024 |
| Debian | — | Upgrade linux-6.1Upgrade linux | Jan 13, 2025 | Dec 27, 2024 |
| Huawei Euleros 2_0_sp11 | — | Upgrade kernel-tools-libsUpgrade kernelUpgrade bpftoolUpgrade kernel-toolsUpgrade python3-perfUpgrade kernel-abi-stablelists | Apr 11, 2025 | Dec 27, 2024 |
| Huawei Euleros 2_0_sp12 | — | Upgrade kernel-abi-stablelistsUpgrade kernel-tools-libsUpgrade bpftoolUpgrade kernel-toolsUpgrade kernelUpgrade python3-perf | Mar 19, 2025 | Dec 27, 2024 |
| Huawei Euleros 2_0_sp13 | — | Upgrade python3-perfUpgrade bpftoolUpgrade kernelUpgrade kernel-abi-stablelistsUpgrade kernel-toolsUpgrade kernel-tools-libs | Apr 1, 2025 | Dec 27, 2024 |
| Oracle_linux | — | Upgrade kernel-uek | Feb 11, 2025 | Dec 27, 2024 |
| Redhat_linux | — | Upgrade kernelNo solution existsUpgrade kernel-rt | Jul 9, 2025 | Dec 27, 2024 |
| Ubuntu | — | Upgrade linux-image-nvidia-64k-hwe-22.04Upgrade linux-image-gkeop-6.8Upgrade linux-image-ibm-classicUpgrade linux-image-snapdragon-hwe-18.04Upgrade linux-image-generic-64k-hwe-22.04Upgrade linux-image-virtualUpgrade linux-image-5.15.0-1077-intel-iotgUpgrade linux-image-kvmUpgrade linux-image-oem-22.04bUpgrade linux-image-6.11.0-1011-lowlatency-64kUpgrade linux-image-5.15.0-1083-azure-fipsUpgrade linux-image-5.15.0-1072-ibmUpgrade linux-image-5.15.0-135-genericUpgrade linux-image-5.4.0-1145-gcp-fipsUpgrade linux-image-6.11.0-1013-oracle-64kUpgrade linux-image-5.15.0-1033-nvidia-tegra-rtUpgrade linux-image-generic-64k-hwe-20.04Upgrade linux-image-5.15.0-135-lowlatency-64kUpgrade linux-image-nvidia-tegra-igx-rtUpgrade linux-image-5.4.0-1145-gcpUpgrade linux-image-oem-osp1Upgrade linux-image-5.4.0-1147-azureUpgrade linux-image-intel-iot-realtimeUpgrade linux-image-azure-lts-20.04Upgrade linux-image-oem-24.04Upgrade linux-image-generic-64kUpgrade linux-image-gke-5.15Upgrade linux-image-gcpUpgrade linux-image-5.15.0-1074-raspiUpgrade linux-image-5.15.0-136-genericUpgrade linux-image-oem-22.04aUpgrade linux-image-5.15.0-1077-gkeUpgrade linux-image-nvidia-64kUpgrade linux-image-5.15.0-1086-azure-fdeUpgrade linux-image-5.15.0-1080-aws-fipsUpgrade linux-image-5.15.0-136-generic-lpaeUpgrade linux-image-generic-hwe-18.04Upgrade linux-image-6.8.0-1027-awsUpgrade linux-image-oracle-64kUpgrade linux-image-5.4.0-211-lowlatencyUpgrade linux-image-bluefieldUpgrade linux-image-5.4.0-211-genericUpgrade linux-image-6.8.0-1027-azureUpgrade linux-image-raspi-hwe-18.04Upgrade linux-image-5.15.0-135-generic-lpaeUpgrade linux-image-5.4.0-1116-fipsUpgrade linux-image-virtual-hwe-24.04Upgrade linux-image-virtual-hwe-22.04Upgrade linux-image-5.4.0-1147-azure-fipsUpgrade linux-image-oracle-lts-22.04Upgrade linux-image-5.4.0-1088-ibmUpgrade linux-image-lowlatency-hwe-24.04Upgrade linux-image-lowlatency-64k-hwe-22.04Upgrade linux-image-oem-20.04dUpgrade linux-image-lowlatency-hwe-20.04Upgrade linux-image-intel-iotgUpgrade linux-image-ibmUpgrade linux-image-oem-24.04bUpgrade linux-image-oracleUpgrade linux-image-6.8.0-1026-oemUpgrade linux-image-oem-20.04Upgrade linux-image-6.8.0-1028-gcpUpgrade linux-image-6.8.0-58-lowlatency-64kUpgrade linux-image-azure-lts-24.04Upgrade linux-image-raspi2Upgrade linux-image-intelUpgrade linux-image-5.15.0-1075-intel-iotgUpgrade linux-image-6.8.0-1026-nvidiaUpgrade linux-image-nvidia-64k-6.8Upgrade linux-image-azure-cvmUpgrade linux-image-generic-lpaeUpgrade linux-image-nvidia-hwe-22.04Upgrade linux-image-lowlatencyUpgrade linux-image-genericUpgrade linux-image-5.15.0-1077-oracleUpgrade linux-image-azure-lts-22.04Upgrade linux-image-oem-22.04cUpgrade linux-image-realtimeUpgrade linux-image-6.8.0-58-lowlatencyUpgrade linux-image-5.15.0-135-lowlatencyUpgrade linux-image-ibm-lts-24.04Upgrade linux-image-5.4.0-1090-ibmUpgrade linux-image-gcp-lts-20.04Upgrade linux-image-aws-lts-22.04Upgrade linux-image-5.15.0-1079-gcpUpgrade linux-image-generic-hwe-24.04Upgrade linux-image-raspi-realtimeUpgrade linux-image-lowlatency-64k-hwe-24.04Upgrade linux-image-nvidia-tegraUpgrade linux-image-5.15.0-1021-nvidia-tegra-igxUpgrade linux-image-lowlatency-hwe-18.04Upgrade linux-image-5.4.0-1142-aws-fipsUpgrade linux-image-generic-hwe-22.04Upgrade linux-image-oem-20.04cUpgrade linux-image-gkeUpgrade linux-image-gkeopUpgrade linux-image-5.15.0-1080-awsUpgrade linux-image-oem-24.04aUpgrade linux-image-5.15.0-1084-azureUpgrade linux-image-6.8.0-1023-gkeUpgrade linux-image-5.4.0-1129-kvmUpgrade linux-image-6.8.0-1024-ibmUpgrade linux-image-6.11.0-1017-oemUpgrade linux-image-6.11.0-1011-awsUpgrade linux-image-aws-lts-24.04Upgrade linux-image-gcp-64kUpgrade linux-image-5.15.0-1033-nvidia-tegraUpgrade linux-image-5.15.0-1079-gcp-fipsUpgrade linux-image-5.15.0-135-generic-64kUpgrade linux-image-xilinx-zynqmpUpgrade linux-image-nvidia-6.8Upgrade linux-image-aws-lts-20.04Upgrade linux-image-azure-fdeUpgrade linux-image-oem-20.04bUpgrade linux-image-6.11.0-1012-azureUpgrade linux-image-5.4.0-1129-raspiUpgrade linux-image-6.8.0-58-genericUpgrade linux-image-5.4.0-1048-iotUpgrade linux-image-6.11.0-1011-gcpUpgrade linux-image-azure-fde-lts-24.04Upgrade linux-image-5.15.0-1074-nvidia-lowlatencyUpgrade linux-image-lowlatency-hwe-22.04Upgrade linux-image-6.11.0-1010-raspiUpgrade linux-image-generic-64k-hwe-24.04Upgrade linux-image-raspi-nolpaeUpgrade linux-image-5.4.0-1101-bluefieldUpgrade linux-image-6.11.0-1007-realtimeUpgrade linux-image-6.8.0-1010-gkeopUpgrade linux-image-lowlatency-64kUpgrade linux-image-6.11.0-1011-gcp-64kUpgrade linux-image-6.8.0-1014-azure-nvidiaUpgrade linux-image-oemUpgrade linux-image-azureUpgrade linux-image-virtual-hwe-20.04Upgrade linux-image-6.8.0-1024-oracle-64kUpgrade linux-image-generic-lpae-hwe-20.04Upgrade linux-image-raspiUpgrade linux-image-generic-hwe-20.04Upgrade linux-image-gcp-64k-lts-24.04Upgrade linux-image-5.4.0-1142-awsUpgrade linux-image-oracle-64k-lts-24.04Upgrade linux-image-5.15.0-1044-xilinx-zynqmpUpgrade linux-image-realtime-hwe-24.04Upgrade linux-image-5.15.0-1086-azureUpgrade linux-image-nvidia-tegra-rtUpgrade linux-image-6.8.0-1026-nvidia-lowlatencyUpgrade linux-image-6.8.0-1026-nvidia-64kUpgrade linux-image-6.8.0-1028-gcp-64kUpgrade linux-image-gcp-lts-24.04Upgrade linux-image-fipsUpgrade linux-image-5.15.0-1076-kvmUpgrade linux-image-oem-22.04dUpgrade linux-image-awsUpgrade linux-image-lowlatency-64k-hwe-20.04Upgrade linux-image-nvidia-lowlatencyUpgrade linux-image-5.15.0-1062-gkeopUpgrade linux-image-gkeop-5.15Upgrade linux-image-gcp-fipsUpgrade linux-image-6.8.0-1027-azure-fdeUpgrade linux-image-5.15.0-1074-nvidiaUpgrade linux-image-aws-fipsUpgrade linux-image-6.8.0-1026-nvidia-lowlatency-64kUpgrade linux-image-6.8.0-2023-raspi-realtimeUpgrade linux-image-5.15.0-1021-nvidia-tegra-igx-rtUpgrade linux-image-6.8.0-58-generic-64kUpgrade linux-image-virtual-hwe-18.04Upgrade linux-image-6.8.1-1020-realtimeUpgrade linux-image-5.15.0-135-fipsUpgrade linux-image-6.11.0-1011-lowlatencyUpgrade linux-image-6.8.0-1028-raspiUpgrade linux-image-azure-fipsUpgrade linux-image-5.4.0-211-generic-lpaeUpgrade linux-image-5.4.0-1140-oracleUpgrade linux-image-6.11.0-21-genericUpgrade linux-image-6.11.0-1013-oracleUpgrade linux-image-nvidiaUpgrade linux-image-nvidia-tegra-igxUpgrade linux-image-5.15.0-1074-ibmUpgrade linux-image-5.15.0-1080-realtimeUpgrade linux-image-oracle-lts-20.04Upgrade linux-image-oem-22.04Upgrade linux-image-azure-nvidiaUpgrade linux-image-5.15.0-1081-gcpUpgrade linux-image-5.4.0-1060-xilinx-zynqmpUpgrade linux-image-6.11.0-21-generic-64kUpgrade linux-image-nvidia-lowlatency-64kUpgrade linux-image-6.8.0-1024-oracleUpgrade linux-image-gcp-lts-22.04Upgrade linux-image-6.11.0-1012-azure-fdeUpgrade linux-image-oracle-lts-24.04Upgrade linux-image-5.15.0-136-generic-64kUpgrade linux-image-5.15.0-1073-intel-iot-realtimeUpgrade linux-image-ibm-lts-20.04 | Mar 28, 2025 | Dec 27, 2024 |
| Vmware Photon_os | — | Use 'tdnf update' to upgrade all packages to the latest version. | Jan 20, 2025 | Dec 27, 2024 |
Prioritise with Active Threat Intelligence
With curated Threat Intelligence, you can see which vulnerabilities truly put you at risk, prioritize what matters most, and act before attackers do.
Explore Intelligence Hub