CVE-2022-49209: Vulnerability in Linux Linux
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>
AI Analysis
Technical Summary
CVE-2022-49209 is a vulnerability in the Linux kernel's Berkeley Packet Filter (BPF) sockmap implementation, specifically within the tcp_bpf_sendmsg() function. The issue arises when tcp_bpf_sendmsg() attempts to send data while the socket message buffer (sk_msg) is full. If the sk_msg_alloc() function returns an -ENOMEM error due to insufficient memory, tcp_bpf_sendmsg() transitions to a wait_for_memory state. However, if partial memory allocation has already occurred (indicated by msg_tx->sg.size being greater than the original size), this memory is not properly released, resulting in a memory leak. This leak can degrade system performance and potentially lead to denial of service due to resource exhaustion. Similar memory leak issues exist in other call paths such as tls_sw_sendmsg(), prompting the fix to incorporate sk_msg_trim() logic inside sk_msg_alloc() to ensure allocated memory is freed appropriately. The vulnerability can cause kernel warnings and stack traces related to socket destruction and closure, indicating instability in network socket handling. Although no known exploits are reported in the wild, the flaw affects the core Linux kernel networking stack, which is widely used across numerous Linux distributions and environments. The vulnerability was resolved by ensuring that partial memory allocations are trimmed and released before waiting for memory, preventing leaks and stabilizing socket message handling under memory pressure conditions.
Potential Impact
For European organizations, this vulnerability poses a risk primarily to systems running Linux kernels with the affected BPF sockmap implementation, including servers, network appliances, and cloud infrastructure. The memory leak can lead to gradual resource exhaustion, causing degraded network performance, application instability, or system crashes, potentially resulting in denial of service conditions. Organizations relying on Linux-based network functions, such as firewalls, load balancers, or container orchestration platforms, may experience service disruptions. Although exploitation does not appear to allow privilege escalation or direct data compromise, the availability impact can affect critical services, especially in sectors like finance, healthcare, and telecommunications where Linux servers are prevalent. The lack of known exploits reduces immediate risk, but the vulnerability's presence in the kernel networking stack means that attackers with local access or the ability to send crafted network traffic could trigger the leak. This is particularly relevant for multi-tenant cloud environments and shared infrastructure common in European data centers. Therefore, the vulnerability could indirectly impact confidentiality and integrity if denial of service leads to fallback on less secure systems or disrupts security monitoring.
Mitigation Recommendations
European organizations should promptly apply the official Linux kernel patches that address CVE-2022-49209 to eliminate the memory leak. In environments where immediate patching is not feasible, monitoring kernel logs for warnings related to sk_stream_kill_queues and inet_sock_destruct can help detect exploitation attempts or memory leak symptoms. Network administrators should limit untrusted user access to systems running vulnerable kernels and restrict the ability to load or use BPF sockmap features to trusted users only. Implementing resource limits (e.g., cgroups memory limits) on processes using BPF sockmap can mitigate the impact of memory leaks by preventing system-wide resource exhaustion. Additionally, organizations should audit their Linux kernel versions across infrastructure to identify and prioritize patching of affected systems. For cloud and containerized environments, updating base images and host kernels is critical. Finally, integrating kernel integrity monitoring and anomaly detection can provide early warning of exploitation attempts or abnormal resource usage patterns related to this vulnerability.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Italy, Spain
CVE-2022-49209: Vulnerability in Linux Linux
Description
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>
AI-Powered Analysis
Technical Analysis
CVE-2022-49209 is a vulnerability in the Linux kernel's Berkeley Packet Filter (BPF) sockmap implementation, specifically within the tcp_bpf_sendmsg() function. The issue arises when tcp_bpf_sendmsg() attempts to send data while the socket message buffer (sk_msg) is full. If the sk_msg_alloc() function returns an -ENOMEM error due to insufficient memory, tcp_bpf_sendmsg() transitions to a wait_for_memory state. However, if partial memory allocation has already occurred (indicated by msg_tx->sg.size being greater than the original size), this memory is not properly released, resulting in a memory leak. This leak can degrade system performance and potentially lead to denial of service due to resource exhaustion. Similar memory leak issues exist in other call paths such as tls_sw_sendmsg(), prompting the fix to incorporate sk_msg_trim() logic inside sk_msg_alloc() to ensure allocated memory is freed appropriately. The vulnerability can cause kernel warnings and stack traces related to socket destruction and closure, indicating instability in network socket handling. Although no known exploits are reported in the wild, the flaw affects the core Linux kernel networking stack, which is widely used across numerous Linux distributions and environments. The vulnerability was resolved by ensuring that partial memory allocations are trimmed and released before waiting for memory, preventing leaks and stabilizing socket message handling under memory pressure conditions.
Potential Impact
For European organizations, this vulnerability poses a risk primarily to systems running Linux kernels with the affected BPF sockmap implementation, including servers, network appliances, and cloud infrastructure. The memory leak can lead to gradual resource exhaustion, causing degraded network performance, application instability, or system crashes, potentially resulting in denial of service conditions. Organizations relying on Linux-based network functions, such as firewalls, load balancers, or container orchestration platforms, may experience service disruptions. Although exploitation does not appear to allow privilege escalation or direct data compromise, the availability impact can affect critical services, especially in sectors like finance, healthcare, and telecommunications where Linux servers are prevalent. The lack of known exploits reduces immediate risk, but the vulnerability's presence in the kernel networking stack means that attackers with local access or the ability to send crafted network traffic could trigger the leak. This is particularly relevant for multi-tenant cloud environments and shared infrastructure common in European data centers. Therefore, the vulnerability could indirectly impact confidentiality and integrity if denial of service leads to fallback on less secure systems or disrupts security monitoring.
Mitigation Recommendations
European organizations should promptly apply the official Linux kernel patches that address CVE-2022-49209 to eliminate the memory leak. In environments where immediate patching is not feasible, monitoring kernel logs for warnings related to sk_stream_kill_queues and inet_sock_destruct can help detect exploitation attempts or memory leak symptoms. Network administrators should limit untrusted user access to systems running vulnerable kernels and restrict the ability to load or use BPF sockmap features to trusted users only. Implementing resource limits (e.g., cgroups memory limits) on processes using BPF sockmap can mitigate the impact of memory leaks by preventing system-wide resource exhaustion. Additionally, organizations should audit their Linux kernel versions across infrastructure to identify and prioritize patching of affected systems. For cloud and containerized environments, updating base images and host kernels is critical. Finally, integrating kernel integrity monitoring and anomaly detection can provide early warning of exploitation attempts or abnormal resource usage patterns related to this vulnerability.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- Linux
- Date Reserved
- 2025-02-26T01:49:39.291Z
- Cisa Enriched
- false
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 682d982dc4522896dcbe5285
Added to database: 5/21/2025, 9:09:01 AM
Last enriched: 6/30/2025, 4:12:52 AM
Last updated: 8/15/2025, 4:16:24 AM
Views: 12
Related Threats
CVE-2025-47206: CWE-787 in QNAP Systems Inc. File Station 5
HighCVE-2025-5296: CWE-59 Improper Link Resolution Before File Access ('Link Following') in Schneider Electric SESU
HighCVE-2025-6625: CWE-20 Improper Input Validation in Schneider Electric Modicon M340
HighCVE-2025-57703: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in Delta Electronics DIAEnergie
MediumCVE-2025-57702: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in Delta Electronics DIAEnergie
MediumActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.