CVE-2023-52986: Vulnerability in Linux Linux
In the Linux kernel, the following vulnerability has been resolved: bpf, sockmap: Check for any of tcp_bpf_prots when cloning a listener A listening socket linked to a sockmap has its sk_prot overridden. It points to one of the struct proto variants in tcp_bpf_prots. The variant depends on the socket's family and which sockmap programs are attached. A child socket cloned from a TCP listener initially inherits their sk_prot. But before cloning is finished, we restore the child's proto to the listener's original non-tcp_bpf_prots one. This happens in tcp_create_openreq_child -> tcp_bpf_clone. Today, in tcp_bpf_clone we detect if the child's proto should be restored by checking only for the TCP_BPF_BASE proto variant. This is not correct. The sk_prot of listening socket linked to a sockmap can point to to any variant in tcp_bpf_prots. If the listeners sk_prot happens to be not the TCP_BPF_BASE variant, then the child socket unintentionally is left if the inherited sk_prot by tcp_bpf_clone. This leads to issues like infinite recursion on close [1], because the child state is otherwise not set up for use with tcp_bpf_prot operations. Adjust the check in tcp_bpf_clone to detect all of tcp_bpf_prots variants. Note that it wouldn't be sufficient to check the socket state when overriding the sk_prot in tcp_bpf_update_proto in order to always use the TCP_BPF_BASE variant for listening sockets. Since commit b8b8315e39ff ("bpf, sockmap: Remove unhash handler for BPF sockmap usage") it is possible for a socket to transition to TCP_LISTEN state while already linked to a sockmap, e.g. connect() -> insert into map -> connect(AF_UNSPEC) -> listen(). [1]: https://lore.kernel.org/all/00000000000073b14905ef2e7401@google.com/
AI Analysis
Technical Summary
CVE-2023-52986 is a vulnerability in the Linux kernel related to the handling of socket protocols (sk_prot) when using BPF (Berkeley Packet Filter) sockmaps. Sockmaps allow attaching BPF programs to sockets for advanced packet processing. The issue arises when a listening TCP socket linked to a sockmap has its sk_prot overridden to point to one of several variants in the tcp_bpf_prots structure, depending on the socket family and attached BPF programs. When a child socket is cloned from such a listener, it initially inherits the parent's sk_prot. The kernel code attempts to restore the child's sk_prot to the original non-BPF variant during cloning via the tcp_bpf_clone function. However, the existing check only verifies if the sk_prot matches the TCP_BPF_BASE variant, ignoring other tcp_bpf_prots variants. If the listener's sk_prot is any other variant, the child socket retains the inherited sk_prot incorrectly. This improper inheritance can cause severe issues such as infinite recursion during socket close operations because the child's state is not properly configured for tcp_bpf_prot operations. The vulnerability stems from an incomplete check in tcp_bpf_clone and the complex state transitions sockets can undergo while linked to sockmaps, including transitioning to TCP_LISTEN state after being inserted into a sockmap. The fix involves adjusting the check to detect all tcp_bpf_prots variants to ensure correct sk_prot restoration. No known exploits are reported in the wild, and no CVSS score has been assigned yet.
Potential Impact
For European organizations, this vulnerability poses a risk primarily to systems running Linux kernels with BPF sockmap support enabled and actively used, especially in environments leveraging advanced networking features such as container orchestration, network function virtualization, or custom packet filtering. The infinite recursion on socket close can lead to kernel crashes or denial of service (DoS), impacting availability of critical network services. This can disrupt business operations, especially for service providers, cloud infrastructure operators, and enterprises relying on Linux-based network appliances. Although exploitation requires specific conditions (use of sockmaps with TCP listeners), the complexity and subtlety of the bug could lead to unexpected system instability or crashes, complicating incident response. Confidentiality and integrity impacts are less direct but could arise if attackers leverage DoS conditions to facilitate further attacks or evade detection. The lack of known exploits suggests limited immediate threat, but the vulnerability's presence in widely deployed Linux kernels means European organizations should prioritize patching to maintain network reliability and security.
Mitigation Recommendations
1. Apply the official Linux kernel patches that address CVE-2023-52986 as soon as they become available from trusted sources or Linux distributions. 2. Audit and monitor the use of BPF sockmaps in your environment; disable or restrict their use if not required, reducing the attack surface. 3. Implement kernel live patching solutions where possible to minimize downtime during patch deployment. 4. Enhance monitoring for kernel crashes or unusual socket behavior that might indicate exploitation attempts or instability related to this vulnerability. 5. For organizations using container orchestration platforms (e.g., Kubernetes) or network virtualization, verify that underlying host kernels are patched and that network plugins do not expose vulnerable configurations. 6. Engage in proactive vulnerability management to track Linux kernel updates and security advisories related to BPF and networking subsystems. 7. Consider isolating critical network functions on dedicated hosts with hardened kernel configurations to limit impact scope.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Norway, Denmark, Belgium, Italy
CVE-2023-52986: Vulnerability in Linux Linux
Description
In the Linux kernel, the following vulnerability has been resolved: bpf, sockmap: Check for any of tcp_bpf_prots when cloning a listener A listening socket linked to a sockmap has its sk_prot overridden. It points to one of the struct proto variants in tcp_bpf_prots. The variant depends on the socket's family and which sockmap programs are attached. A child socket cloned from a TCP listener initially inherits their sk_prot. But before cloning is finished, we restore the child's proto to the listener's original non-tcp_bpf_prots one. This happens in tcp_create_openreq_child -> tcp_bpf_clone. Today, in tcp_bpf_clone we detect if the child's proto should be restored by checking only for the TCP_BPF_BASE proto variant. This is not correct. The sk_prot of listening socket linked to a sockmap can point to to any variant in tcp_bpf_prots. If the listeners sk_prot happens to be not the TCP_BPF_BASE variant, then the child socket unintentionally is left if the inherited sk_prot by tcp_bpf_clone. This leads to issues like infinite recursion on close [1], because the child state is otherwise not set up for use with tcp_bpf_prot operations. Adjust the check in tcp_bpf_clone to detect all of tcp_bpf_prots variants. Note that it wouldn't be sufficient to check the socket state when overriding the sk_prot in tcp_bpf_update_proto in order to always use the TCP_BPF_BASE variant for listening sockets. Since commit b8b8315e39ff ("bpf, sockmap: Remove unhash handler for BPF sockmap usage") it is possible for a socket to transition to TCP_LISTEN state while already linked to a sockmap, e.g. connect() -> insert into map -> connect(AF_UNSPEC) -> listen(). [1]: https://lore.kernel.org/all/00000000000073b14905ef2e7401@google.com/
AI-Powered Analysis
Technical Analysis
CVE-2023-52986 is a vulnerability in the Linux kernel related to the handling of socket protocols (sk_prot) when using BPF (Berkeley Packet Filter) sockmaps. Sockmaps allow attaching BPF programs to sockets for advanced packet processing. The issue arises when a listening TCP socket linked to a sockmap has its sk_prot overridden to point to one of several variants in the tcp_bpf_prots structure, depending on the socket family and attached BPF programs. When a child socket is cloned from such a listener, it initially inherits the parent's sk_prot. The kernel code attempts to restore the child's sk_prot to the original non-BPF variant during cloning via the tcp_bpf_clone function. However, the existing check only verifies if the sk_prot matches the TCP_BPF_BASE variant, ignoring other tcp_bpf_prots variants. If the listener's sk_prot is any other variant, the child socket retains the inherited sk_prot incorrectly. This improper inheritance can cause severe issues such as infinite recursion during socket close operations because the child's state is not properly configured for tcp_bpf_prot operations. The vulnerability stems from an incomplete check in tcp_bpf_clone and the complex state transitions sockets can undergo while linked to sockmaps, including transitioning to TCP_LISTEN state after being inserted into a sockmap. The fix involves adjusting the check to detect all tcp_bpf_prots variants to ensure correct sk_prot restoration. No known exploits are reported in the wild, and no CVSS score has been assigned yet.
Potential Impact
For European organizations, this vulnerability poses a risk primarily to systems running Linux kernels with BPF sockmap support enabled and actively used, especially in environments leveraging advanced networking features such as container orchestration, network function virtualization, or custom packet filtering. The infinite recursion on socket close can lead to kernel crashes or denial of service (DoS), impacting availability of critical network services. This can disrupt business operations, especially for service providers, cloud infrastructure operators, and enterprises relying on Linux-based network appliances. Although exploitation requires specific conditions (use of sockmaps with TCP listeners), the complexity and subtlety of the bug could lead to unexpected system instability or crashes, complicating incident response. Confidentiality and integrity impacts are less direct but could arise if attackers leverage DoS conditions to facilitate further attacks or evade detection. The lack of known exploits suggests limited immediate threat, but the vulnerability's presence in widely deployed Linux kernels means European organizations should prioritize patching to maintain network reliability and security.
Mitigation Recommendations
1. Apply the official Linux kernel patches that address CVE-2023-52986 as soon as they become available from trusted sources or Linux distributions. 2. Audit and monitor the use of BPF sockmaps in your environment; disable or restrict their use if not required, reducing the attack surface. 3. Implement kernel live patching solutions where possible to minimize downtime during patch deployment. 4. Enhance monitoring for kernel crashes or unusual socket behavior that might indicate exploitation attempts or instability related to this vulnerability. 5. For organizations using container orchestration platforms (e.g., Kubernetes) or network virtualization, verify that underlying host kernels are patched and that network plugins do not expose vulnerable configurations. 6. Engage in proactive vulnerability management to track Linux kernel updates and security advisories related to BPF and networking subsystems. 7. Consider isolating critical network functions on dedicated hosts with hardened kernel configurations to limit impact scope.
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-03-27T16:40:15.741Z
- Cisa Enriched
- false
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 682d982fc4522896dcbe6c47
Added to database: 5/21/2025, 9:09:03 AM
Last enriched: 7/1/2025, 2:54:53 AM
Last updated: 8/8/2025, 4:14:37 PM
Views: 19
Related Threats
CVE-2025-8690: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in addix Simple Responsive Slider
MediumCVE-2025-8688: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in ebernstein Inline Stock Quotes
MediumCVE-2025-8685: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in emilien Wp chart generator
MediumCVE-2025-8621: CWE-80 Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) in odn Mosaic Generator
MediumCVE-2025-8568: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in prabode GMap Generator
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.