Skip to main content

CVE-2022-49207: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2022-49207cvecve-2022-49207
Published: Wed Feb 26 2025 (02/26/2025, 01:55:46 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: bpf, sockmap: Fix memleak in sk_psock_queue_msg If tcp_bpf_sendmsg is running during a tear down operation we may enqueue data on the ingress msg queue while tear down is trying to free it. sk1 (redirect sk2) sk2 ------------------- --------------- tcp_bpf_sendmsg() tcp_bpf_send_verdict() tcp_bpf_sendmsg_redir() bpf_tcp_ingress() sock_map_close() lock_sock() lock_sock() ... blocking sk_psock_stop sk_psock_clear_state(psock, SK_PSOCK_TX_ENABLED); release_sock(sk); lock_sock() sk_mem_charge() get_page() sk_psock_queue_msg() sk_psock_test_state(psock, SK_PSOCK_TX_ENABLED); drop_sk_msg() release_sock() While drop_sk_msg(), the msg has charged memory form sk by sk_mem_charge and has sg pages need to put. To fix we use sk_msg_free() and then kfee() msg. This issue can cause the following info: WARNING: CPU: 0 PID: 9202 at net/core/stream.c:205 sk_stream_kill_queues+0xc8/0xe0 Call Trace: <IRQ> inet_csk_destroy_sock+0x55/0x110 tcp_rcv_state_process+0xe5f/0xe90 ? sk_filter_trim_cap+0x10d/0x230 ? tcp_v4_do_rcv+0x161/0x250 tcp_v4_do_rcv+0x161/0x250 tcp_v4_rcv+0xc3a/0xce0 ip_protocol_deliver_rcu+0x3d/0x230 ip_local_deliver_finish+0x54/0x60 ip_local_deliver+0xfd/0x110 ? ip_protocol_deliver_rcu+0x230/0x230 ip_rcv+0xd6/0x100 ? ip_local_deliver+0x110/0x110 __netif_receive_skb_one_core+0x85/0xa0 process_backlog+0xa4/0x160 __napi_poll+0x29/0x1b0 net_rx_action+0x287/0x300 __do_softirq+0xff/0x2fc do_softirq+0x79/0x90 </IRQ> WARNING: CPU: 0 PID: 531 at net/ipv4/af_inet.c:154 inet_sock_destruct+0x175/0x1b0 Call Trace: <TASK> __sk_destruct+0x24/0x1f0 sk_psock_destroy+0x19b/0x1c0 process_one_work+0x1b3/0x3c0 ? process_one_work+0x3c0/0x3c0 worker_thread+0x30/0x350 ? process_one_work+0x3c0/0x3c0 kthread+0xe6/0x110 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x22/0x30 </TASK>

AI-Powered Analysis

AILast updated: 06/30/2025, 04:12:26 UTC

Technical Analysis

CVE-2022-49207 is a vulnerability in the Linux kernel related to the BPF (Berkeley Packet Filter) sockmap implementation, specifically in the handling of TCP socket message queues during teardown operations. The issue arises when the function tcp_bpf_sendmsg is executing concurrently with socket teardown, leading to a race condition where data may be enqueued on an ingress message queue while the teardown process attempts to free the same resources. This can cause a memory leak due to improper freeing of socket messages, as the message has already charged memory via sk_mem_charge and contains scatter-gather pages that need to be released. The vulnerability manifests in kernel warnings and potential resource exhaustion, as indicated by kernel call traces involving functions such as sk_stream_kill_queues, inet_csk_destroy_sock, and sk_psock_destroy. The root cause is a lack of proper synchronization and cleanup in the BPF sockmap code paths, which can lead to memory not being freed correctly during socket closure. Although no known exploits are reported in the wild, the vulnerability affects Linux kernel versions identified by the given commit hashes, and it has been publicly disclosed without an assigned CVSS score. The issue is technical and low-level, involving kernel networking internals and BPF socket maps, which are used for advanced packet processing and redirection in modern Linux networking stacks.

Potential Impact

For European organizations, this vulnerability could lead to memory leaks in Linux systems that utilize BPF sockmap features for TCP socket message handling. Over time, these leaks may cause resource exhaustion, potentially degrading system performance or causing denial of service (DoS) conditions on critical infrastructure such as servers, network appliances, or cloud platforms running Linux. Organizations relying on Linux-based networking equipment, container orchestration platforms, or cloud services that leverage BPF for traffic control and monitoring could experience instability or outages. While the vulnerability does not directly enable code execution or privilege escalation, the resulting DoS could disrupt business operations, especially in sectors with high availability requirements such as finance, telecommunications, healthcare, and critical infrastructure. The lack of known exploits reduces immediate risk, but the complexity of the issue means that targeted attackers with kernel-level access could potentially leverage it to degrade service or evade detection by causing kernel warnings and instability.

Mitigation Recommendations

To mitigate this vulnerability, European organizations should promptly apply the official Linux kernel patches that address the BPF sockmap memory leak once available. In the interim, organizations should audit their use of BPF sockmap features, particularly in TCP socket message redirection and ingress processing, and consider disabling or limiting these features if feasible. Monitoring kernel logs for warnings related to sk_stream_kill_queues or inet_sock_destruct can help detect attempts to exploit or trigger the issue. Additionally, implementing strict kernel update policies and testing patches in staging environments before production deployment will reduce operational risk. For environments using container orchestration or cloud platforms, ensure that underlying host kernels are updated and that container runtimes do not expose vulnerable kernel interfaces. Network segmentation and limiting access to systems with kernel-level privileges can also reduce the attack surface. Finally, maintain comprehensive resource monitoring to detect abnormal memory usage patterns that may indicate exploitation attempts.

Need more detailed analysis?Get Pro

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: 682d982dc4522896dcbe5272

Added to database: 5/21/2025, 9:09:01 AM

Last enriched: 6/30/2025, 4:12:26 AM

Last updated: 8/2/2025, 11:14:16 AM

Views: 9

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats