CVE-2022-49209: bpf, sockmap: Fix memleak in tcp_bpf_sendmsg while sk msg is full
In the Linux kernel, the following vulnerability has been resolved:
bpf, sockmap: Fix memleak in tcp_bpf_sendmsg while sk msg is full
If tcp_bpf_sendmsg() is running while sk msg is full. When sk_msg_alloc()
returns -ENOMEM error, tcp_bpf_sendmsg() goes to wait_for_memory. If partial
memory has been alloced by sk_msg_alloc(), that is, msg_tx->sg.size is
greater than osize after sk_msg_alloc(), memleak occurs. To fix we use
sk_msg_trim() to release the allocated memory, then goto wait for memory.
Other call paths of sk_msg_alloc() have the similar issue, such as
tls_sw_sendmsg(), so handle sk_msg_trim logic inside sk_msg_alloc(),
as Cong Wang suggested.
This issue can cause the following info:
WARNING: CPU: 3 PID: 7950 at net/core/stream.c:208 sk_stream_kill_queues+0xd4/0x1a0
Call Trace:
<TASK>
inet_csk_destroy_sock+0x55/0x110
__tcp_close+0x279/0x470
tcp_close+0x1f/0x60
inet_release+0x3f/0x80
__sock_release+0x3d/0xb0
sock_close+0x11/0x20
__fput+0x92/0x250
task_work_run+0x6a/0xa0
do_exit+0x33b/0xb60
do_group_exit+0x2f/0xa0
get_signal+0xb6/0x950
arch_do_signal_or_restart+0xac/0x2a0
exit_to_user_mode_prepare+0xa9/0x200
syscall_exit_to_user_mode+0x12/0x30
do_syscall_64+0x46/0x80
entry_SYSCALL_64_after_hwframe+0x44/0xae
</TASK>
WARNING: CPU: 3 PID: 2094 at net/ipv4/af_inet.c:155 inet_sock_destruct+0x13c/0x260
Call Trace:
<TASK>
__sk_destruct+0x24/0x1f0
sk_psock_destroy+0x19b/0x1c0
process_one_work+0x1b3/0x3c0
kthread+0xe6/0x110
ret_from_fork+0x22/0x30
</TASK>
Security readout for executives and security teams
Plain-English summary
CVE-2022-49209 is a Linux kernel memory leak in BPF sockmap TCP send handling. A local, low-privileged user could trigger resource exhaustion, creating an availability risk rather than data theft or tampering.
Executive priority
Schedule remediation through normal kernel patch cycles, with higher priority for shared Linux infrastructure where local users or workloads are less trusted. There is no source-backed evidence here of active exploitation, but availability impact can matter on critical hosts.
Technical view
The issue is a CWE-401 memory leak in tcp_bpf_sendmsg when sk_msg_alloc returns ENOMEM after partial allocation while sk_msg is full. The fix trims partially allocated sk_msg memory inside sk_msg_alloc, covering similar call paths such as tls_sw_sendmsg.
Likely exposure
Exposure is limited to Linux systems running affected kernel versions with reachable local user execution. The bundle lists Linux as affected with version markers including 4.20, 5.4.189, 5.10.110, 5.15.33, 5.16.19, 5.17.2, and 5.18. Distribution impact requires package-level confirmation.
Exploitation context
The CVSS vector is local, low complexity, low privilege, no user interaction, and high availability impact. The source bundle does not show KEV listing or cited evidence of active exploitation. Treat this as a local denial-of-service risk unless vendor advisories say otherwise.
Researcher notes
Validation should focus on kernel provenance and branch-specific fixes. The bundle references multiple stable commits but does not provide distribution backport status. Avoid assuming exploitability beyond local low-privilege availability impact unless additional vendor or KEV evidence emerges.
Mitigation direction
Apply the relevant Linux kernel stable update for each affected kernel branch.
Check your distribution vendor advisory for the packaged kernel fix status.
Prioritize multi-user servers, container hosts, and shared compute environments.
Use normal kernel rollout safeguards, including reboot planning and regression checks.
Validation and detection
Inventory Linux kernel versions across servers, endpoints, and container hosts.
Map each kernel to the distribution vendor’s fixed package or stable commit.
Confirm BPF sockmap exposure assumptions with platform owners.
After patching, verify the running kernel version, not just installed packages.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-401: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-401 · source CWE mapping
Missing Release of Memory after Effective Lifetime
Missing Release of Memory after Effective Lifetime represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.