Memory Leak in tcp_bpf_sendmsg in Kernel

Kernel Updated 02 Oct 2025

Summary

24/04/2022
N/A
No i
Unrated
Not published

GSD-2022-1001208: bpf, sockmap: Fix memleak in tcp_bpf_sendmsg while sk msg is full. Affects Kernel versions >= 604326b41a6fb9b4a78b6179335decee0365cd8c, < d0b85dfc6f01d26808e2576c6537c131b590e270. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The Kernel is a critical component of the Linux operating system that manages the system's resources and facilitates communication between hardware and software. It provides essential functions and services to enable the proper functioning of the system. The tcp_bpf_sendmsg function is responsible for sending messages over TCP sockets using Berkeley Packet Filter (BPF) programs. BPF is a technology that allows users to define custom filters for network packets. However, a memory leak vulnerability has been discovered in the tcp_bpf_sendmsg function, which can lead to resource exhaustion and potential denial-of-service attacks.

Vulnerability Detail

The memory leak vulnerability in tcp_bpf_sendmsg occurs when the socket message (sk msg) is full. This can happen when the BPF program attached to the socket generates a large number of messages, overwhelming the system's memory resources. Attackers can exploit this vulnerability by sending specially crafted packets to a vulnerable system, causing it to exhaust its memory and potentially crash. The vulnerability was introduced in version 4.20 of the Linux Kernel and has been fixed in version 5.17.2.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

If updating the Kernel is not immediately feasible, a temporary workaround is to limit the number of messages generated by the BPF program attached to the socket. This can be achieved by modifying the BPF program code to reduce the frequency or volume of generated messages. However, this workaround may impact the functionality or performance of the affected system.

Conclusion

The memory leak vulnerability in tcp_bpf_sendmsg can have serious consequences, including resource exhaustion and potential denial-of-service attacks. It is crucial to update the Linux Kernel to version 5.17.2 or later to mitigate this vulnerability. Regularly updating the Kernel and applying security patches is essential for maintaining the security and stability of the system. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for Kernel →

Share this vulnerability

FAQ

The memory leak vulnerability in tcp_bpf_sendmsg can lead to resource exhaustion and potential denial-of-service attacks. Attackers can exploit this vulnerability to crash vulnerable systems by sending specially crafted packets.

You can check if your system is affected by this vulnerability by using the Vulert Playground (https://vulert.com/scanner). Simply upload your package-lock.json file, and Vulert will analyze it to identify any open-source vulnerabilities, including this memory leak vulnerability.

Yes, a patch for this vulnerability has been released in version 5.17.2 of the Linux Kernel. It is recommended to update your Kernel to this version or later to mitigate the risk.

Yes, this vulnerability can be exploited remotely by sending specially crafted packets to a vulnerable system. However, successful exploitation requires the system to have the vulnerable version of the Kernel and the BPF program attached to the socket.

There are no known instances of this vulnerability being actively exploited in the wild. However, it is important to apply the necessary patches and updates to protect against potential future attacks.

Related vulnerabilities

Recent vulnerabilities recorded for Kernel.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback