CVE-2022-49697: Vulnerability in Linux Linux
In the Linux kernel, the following vulnerability has been resolved: bpf: Fix request_sock leak in sk lookup helpers A customer reported a request_socket leak in a Calico cloud environment. We found that a BPF program was doing a socket lookup with takes a refcnt on the socket and that it was finding the request_socket but returning the parent LISTEN socket via sk_to_full_sk() without decrementing the child request socket 1st, resulting in request_sock slab object leak. This patch retains the existing behaviour of returning full socks to the caller but it also decrements the child request_socket if one is present before doing so to prevent the leak. Thanks to Curtis Taylor for all the help in diagnosing and testing this. And thanks to Antoine Tenart for the reproducer and patch input. v2 of this patch contains, refactor as per Daniel Borkmann's suggestions to validate RCU flags on the listen socket so that it balances with bpf_sk_release() and update comments as per Martin KaFai Lau's suggestion. One small change to Daniels suggestion, put "sk = sk2" under "if (sk2 != sk)" to avoid an extra instruction.
AI Analysis
Technical Summary
CVE-2022-49697 is a vulnerability identified in the Linux kernel's Berkeley Packet Filter (BPF) subsystem, specifically related to socket lookup helpers. The issue arises when a BPF program performs a socket lookup that increments the reference count on a socket. In this case, the lookup finds a request_socket (a child socket used during connection establishment) but returns the parent LISTEN socket via the sk_to_full_sk() function without first decrementing the reference count on the child request_socket. This results in a memory leak of the request_sock slab object. The vulnerability was initially reported by a customer operating a Calico cloud environment, where this leak was observed. The patch fixes the issue by retaining the behavior of returning the full socket to the caller while ensuring the child request_socket's reference count is decremented before returning the parent socket, preventing the leak. The fix also includes validation of Read-Copy-Update (RCU) flags on the listen socket to balance with bpf_sk_release() calls and minor code refactoring to optimize instructions. This vulnerability does not appear to have any known exploits in the wild and lacks an assigned CVSS score. The root cause is a resource management flaw in the kernel's BPF socket lookup helpers, which could lead to resource exhaustion over time if exploited or triggered repeatedly.
Potential Impact
For European organizations, the impact of CVE-2022-49697 primarily relates to potential resource exhaustion on Linux systems running BPF programs that perform socket lookups, such as those used in cloud-native networking environments like Calico. Since BPF is widely used for network monitoring, security, and traffic control, this vulnerability could degrade system performance or cause denial of service due to leaked request_socket objects accumulating in kernel memory. This is particularly relevant for data centers, cloud service providers, and enterprises leveraging Linux-based container orchestration platforms (e.g., Kubernetes) with BPF-enabled networking plugins. While the vulnerability does not directly allow privilege escalation or code execution, the resulting memory leak could impact availability and stability of critical infrastructure. European organizations relying on Linux for networking, cloud, or edge computing workloads may experience service disruptions or increased maintenance overhead if the vulnerability is exploited or triggered inadvertently. However, the absence of known exploits and the requirement for specific BPF program behavior reduce the immediate risk of widespread attacks.
Mitigation Recommendations
1. Apply the official Linux kernel patch that addresses CVE-2022-49697 as soon as it is available and tested in your environment. This is the definitive fix preventing the request_socket leak. 2. Audit and review BPF programs in use, especially those performing socket lookups, to ensure they follow best practices for reference count management and do not inadvertently cause resource leaks. 3. Monitor kernel memory usage and slab allocator statistics for anomalies that could indicate leaking request_socket objects, enabling early detection of exploitation or misbehavior. 4. Limit the deployment of untrusted or third-party BPF programs in production environments to reduce the risk of triggering this vulnerability. 5. For cloud environments using Calico or similar CNI plugins, coordinate with vendors and update to versions incorporating the fix. 6. Implement kernel live patching solutions where feasible to reduce downtime during patch deployment. 7. Maintain robust logging and alerting on kernel errors and resource exhaustion symptoms to facilitate rapid incident response.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Ireland, Denmark
CVE-2022-49697: Vulnerability in Linux Linux
Description
In the Linux kernel, the following vulnerability has been resolved: bpf: Fix request_sock leak in sk lookup helpers A customer reported a request_socket leak in a Calico cloud environment. We found that a BPF program was doing a socket lookup with takes a refcnt on the socket and that it was finding the request_socket but returning the parent LISTEN socket via sk_to_full_sk() without decrementing the child request socket 1st, resulting in request_sock slab object leak. This patch retains the existing behaviour of returning full socks to the caller but it also decrements the child request_socket if one is present before doing so to prevent the leak. Thanks to Curtis Taylor for all the help in diagnosing and testing this. And thanks to Antoine Tenart for the reproducer and patch input. v2 of this patch contains, refactor as per Daniel Borkmann's suggestions to validate RCU flags on the listen socket so that it balances with bpf_sk_release() and update comments as per Martin KaFai Lau's suggestion. One small change to Daniels suggestion, put "sk = sk2" under "if (sk2 != sk)" to avoid an extra instruction.
AI-Powered Analysis
Technical Analysis
CVE-2022-49697 is a vulnerability identified in the Linux kernel's Berkeley Packet Filter (BPF) subsystem, specifically related to socket lookup helpers. The issue arises when a BPF program performs a socket lookup that increments the reference count on a socket. In this case, the lookup finds a request_socket (a child socket used during connection establishment) but returns the parent LISTEN socket via the sk_to_full_sk() function without first decrementing the reference count on the child request_socket. This results in a memory leak of the request_sock slab object. The vulnerability was initially reported by a customer operating a Calico cloud environment, where this leak was observed. The patch fixes the issue by retaining the behavior of returning the full socket to the caller while ensuring the child request_socket's reference count is decremented before returning the parent socket, preventing the leak. The fix also includes validation of Read-Copy-Update (RCU) flags on the listen socket to balance with bpf_sk_release() calls and minor code refactoring to optimize instructions. This vulnerability does not appear to have any known exploits in the wild and lacks an assigned CVSS score. The root cause is a resource management flaw in the kernel's BPF socket lookup helpers, which could lead to resource exhaustion over time if exploited or triggered repeatedly.
Potential Impact
For European organizations, the impact of CVE-2022-49697 primarily relates to potential resource exhaustion on Linux systems running BPF programs that perform socket lookups, such as those used in cloud-native networking environments like Calico. Since BPF is widely used for network monitoring, security, and traffic control, this vulnerability could degrade system performance or cause denial of service due to leaked request_socket objects accumulating in kernel memory. This is particularly relevant for data centers, cloud service providers, and enterprises leveraging Linux-based container orchestration platforms (e.g., Kubernetes) with BPF-enabled networking plugins. While the vulnerability does not directly allow privilege escalation or code execution, the resulting memory leak could impact availability and stability of critical infrastructure. European organizations relying on Linux for networking, cloud, or edge computing workloads may experience service disruptions or increased maintenance overhead if the vulnerability is exploited or triggered inadvertently. However, the absence of known exploits and the requirement for specific BPF program behavior reduce the immediate risk of widespread attacks.
Mitigation Recommendations
1. Apply the official Linux kernel patch that addresses CVE-2022-49697 as soon as it is available and tested in your environment. This is the definitive fix preventing the request_socket leak. 2. Audit and review BPF programs in use, especially those performing socket lookups, to ensure they follow best practices for reference count management and do not inadvertently cause resource leaks. 3. Monitor kernel memory usage and slab allocator statistics for anomalies that could indicate leaking request_socket objects, enabling early detection of exploitation or misbehavior. 4. Limit the deployment of untrusted or third-party BPF programs in production environments to reduce the risk of triggering this vulnerability. 5. For cloud environments using Calico or similar CNI plugins, coordinate with vendors and update to versions incorporating the fix. 6. Implement kernel live patching solutions where feasible to reduce downtime during patch deployment. 7. Maintain robust logging and alerting on kernel errors and resource exhaustion symptoms to facilitate rapid incident response.
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-26T02:21:30.443Z
- Cisa Enriched
- false
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 682d982cc4522896dcbe488f
Added to database: 5/21/2025, 9:09:00 AM
Last enriched: 6/30/2025, 12:12:32 AM
Last updated: 8/14/2025, 10:44:00 AM
Views: 12
Related Threats
CVE-2025-53948: CWE-415 Double Free in Santesoft Sante PACS Server
HighCVE-2025-52584: CWE-122 Heap-based Buffer Overflow in Ashlar-Vellum Cobalt
HighCVE-2025-46269: CWE-122 Heap-based Buffer Overflow in Ashlar-Vellum Cobalt
HighCVE-2025-54862: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in Santesoft Sante PACS Server
MediumCVE-2025-54759: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in Santesoft Sante PACS Server
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.