CVE-2021-47130: Vulnerability in Linux Linux
In the Linux kernel, the following vulnerability has been resolved: nvmet: fix freeing unallocated p2pmem In case p2p device was found but the p2p pool is empty, the nvme target is still trying to free the sgl from the p2p pool instead of the regular sgl pool and causing a crash (BUG() is called). Instead, assign the p2p_dev for the request only if it was allocated from p2p pool. This is the crash that was caused: [Sun May 30 19:13:53 2021] ------------[ cut here ]------------ [Sun May 30 19:13:53 2021] kernel BUG at lib/genalloc.c:518! [Sun May 30 19:13:53 2021] invalid opcode: 0000 [#1] SMP PTI ... [Sun May 30 19:13:53 2021] kernel BUG at lib/genalloc.c:518! ... [Sun May 30 19:13:53 2021] RIP: 0010:gen_pool_free_owner+0xa8/0xb0 ... [Sun May 30 19:13:53 2021] Call Trace: [Sun May 30 19:13:53 2021] ------------[ cut here ]------------ [Sun May 30 19:13:53 2021] pci_free_p2pmem+0x2b/0x70 [Sun May 30 19:13:53 2021] pci_p2pmem_free_sgl+0x4f/0x80 [Sun May 30 19:13:53 2021] nvmet_req_free_sgls+0x1e/0x80 [nvmet] [Sun May 30 19:13:53 2021] kernel BUG at lib/genalloc.c:518! [Sun May 30 19:13:53 2021] nvmet_rdma_release_rsp+0x4e/0x1f0 [nvmet_rdma] [Sun May 30 19:13:53 2021] nvmet_rdma_send_done+0x1c/0x60 [nvmet_rdma]
AI Analysis
Technical Summary
CVE-2021-47130 is a medium-severity vulnerability in the Linux kernel's NVMe target (nvmet) subsystem related to peer-to-peer (p2p) memory management. The flaw occurs when the nvmet driver attempts to free a scatter-gather list (SGL) from a p2p memory pool that is empty, despite detecting a p2p device. Specifically, if a p2p device is found but the p2p memory pool is empty, the nvmet target erroneously tries to free the SGL from the p2p pool instead of the regular SGL pool. This incorrect memory free operation triggers a kernel BUG, causing a kernel crash (denoted by BUG() invocation) and resulting in a denial of service (DoS) condition. The crash occurs in the genalloc.c memory allocator component, as evidenced by kernel logs showing a BUG at gen_pool_free_owner. The issue arises in functions such as pci_free_p2pmem, pci_p2pmem_free_sgl, nvmet_req_free_sgls, and nvmet_rdma_release_rsp, which handle freeing of p2p memory and NVMe target RDMA responses. The vulnerability requires local privileges with high-level permissions (PR:H) and does not require user interaction. The attack vector is local (AV:L), and the impact is limited to availability (A:H), with no confidentiality or integrity impact. The vulnerability has a CVSS v3.1 base score of 4.4 (medium severity). No known exploits are reported in the wild. The flaw was addressed by modifying the nvmet driver to assign the p2p device for the request only if the memory was actually allocated from the p2p pool, preventing the invalid free and subsequent crash. This vulnerability affects Linux kernel versions containing the specified commit hashes prior to the fix. Since the Linux kernel is widely deployed across servers, desktops, and embedded systems, this bug could cause system instability or denial of service on affected systems running the vulnerable kernel versions with nvmet enabled and using p2p memory features.
Potential Impact
For European organizations, the primary impact of CVE-2021-47130 is the potential for local denial of service on Linux systems running vulnerable kernel versions with the nvmet subsystem enabled and utilizing peer-to-peer memory. This could affect data centers, cloud providers, and enterprises relying on Linux-based storage servers or NVMe over Fabrics (NVMe-oF) deployments, especially those using RDMA or PCIe peer-to-peer memory features. While the vulnerability does not allow privilege escalation, data leakage, or integrity compromise, the induced kernel crash could disrupt critical storage services, leading to downtime and operational impact. Organizations with high availability requirements or those running high-performance computing clusters with NVMe targets may experience service interruptions. The requirement for local high privileges limits remote exploitation, but insider threats or compromised local accounts could trigger the crash. The absence of known exploits reduces immediate risk, but unpatched systems remain vulnerable to accidental or intentional crashes. European organizations with strict uptime SLAs and regulatory requirements for service continuity should prioritize patching to avoid availability disruptions.
Mitigation Recommendations
1. Apply the official Linux kernel patches that address CVE-2021-47130 as soon as possible. Ensure kernel versions are updated to include the fix that correctly handles p2p memory freeing in the nvmet driver. 2. Audit and monitor systems running the nvmet subsystem and using peer-to-peer memory features to identify vulnerable kernel versions. 3. Restrict local access to trusted administrators only, minimizing the risk of local exploitation by unauthorized users. 4. For environments not requiring NVMe target or p2p memory features, consider disabling the nvmet module or related kernel options to reduce the attack surface. 5. Implement robust monitoring and alerting for kernel crashes and BUG() invocations to detect exploitation attempts or accidental triggers early. 6. Test kernel updates in staging environments to ensure compatibility and stability before deployment in production, especially in storage-critical systems. 7. Maintain up-to-date backups and disaster recovery plans to mitigate the impact of potential service disruptions caused by kernel crashes.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Italy
CVE-2021-47130: Vulnerability in Linux Linux
Description
In the Linux kernel, the following vulnerability has been resolved: nvmet: fix freeing unallocated p2pmem In case p2p device was found but the p2p pool is empty, the nvme target is still trying to free the sgl from the p2p pool instead of the regular sgl pool and causing a crash (BUG() is called). Instead, assign the p2p_dev for the request only if it was allocated from p2p pool. This is the crash that was caused: [Sun May 30 19:13:53 2021] ------------[ cut here ]------------ [Sun May 30 19:13:53 2021] kernel BUG at lib/genalloc.c:518! [Sun May 30 19:13:53 2021] invalid opcode: 0000 [#1] SMP PTI ... [Sun May 30 19:13:53 2021] kernel BUG at lib/genalloc.c:518! ... [Sun May 30 19:13:53 2021] RIP: 0010:gen_pool_free_owner+0xa8/0xb0 ... [Sun May 30 19:13:53 2021] Call Trace: [Sun May 30 19:13:53 2021] ------------[ cut here ]------------ [Sun May 30 19:13:53 2021] pci_free_p2pmem+0x2b/0x70 [Sun May 30 19:13:53 2021] pci_p2pmem_free_sgl+0x4f/0x80 [Sun May 30 19:13:53 2021] nvmet_req_free_sgls+0x1e/0x80 [nvmet] [Sun May 30 19:13:53 2021] kernel BUG at lib/genalloc.c:518! [Sun May 30 19:13:53 2021] nvmet_rdma_release_rsp+0x4e/0x1f0 [nvmet_rdma] [Sun May 30 19:13:53 2021] nvmet_rdma_send_done+0x1c/0x60 [nvmet_rdma]
AI-Powered Analysis
Technical Analysis
CVE-2021-47130 is a medium-severity vulnerability in the Linux kernel's NVMe target (nvmet) subsystem related to peer-to-peer (p2p) memory management. The flaw occurs when the nvmet driver attempts to free a scatter-gather list (SGL) from a p2p memory pool that is empty, despite detecting a p2p device. Specifically, if a p2p device is found but the p2p memory pool is empty, the nvmet target erroneously tries to free the SGL from the p2p pool instead of the regular SGL pool. This incorrect memory free operation triggers a kernel BUG, causing a kernel crash (denoted by BUG() invocation) and resulting in a denial of service (DoS) condition. The crash occurs in the genalloc.c memory allocator component, as evidenced by kernel logs showing a BUG at gen_pool_free_owner. The issue arises in functions such as pci_free_p2pmem, pci_p2pmem_free_sgl, nvmet_req_free_sgls, and nvmet_rdma_release_rsp, which handle freeing of p2p memory and NVMe target RDMA responses. The vulnerability requires local privileges with high-level permissions (PR:H) and does not require user interaction. The attack vector is local (AV:L), and the impact is limited to availability (A:H), with no confidentiality or integrity impact. The vulnerability has a CVSS v3.1 base score of 4.4 (medium severity). No known exploits are reported in the wild. The flaw was addressed by modifying the nvmet driver to assign the p2p device for the request only if the memory was actually allocated from the p2p pool, preventing the invalid free and subsequent crash. This vulnerability affects Linux kernel versions containing the specified commit hashes prior to the fix. Since the Linux kernel is widely deployed across servers, desktops, and embedded systems, this bug could cause system instability or denial of service on affected systems running the vulnerable kernel versions with nvmet enabled and using p2p memory features.
Potential Impact
For European organizations, the primary impact of CVE-2021-47130 is the potential for local denial of service on Linux systems running vulnerable kernel versions with the nvmet subsystem enabled and utilizing peer-to-peer memory. This could affect data centers, cloud providers, and enterprises relying on Linux-based storage servers or NVMe over Fabrics (NVMe-oF) deployments, especially those using RDMA or PCIe peer-to-peer memory features. While the vulnerability does not allow privilege escalation, data leakage, or integrity compromise, the induced kernel crash could disrupt critical storage services, leading to downtime and operational impact. Organizations with high availability requirements or those running high-performance computing clusters with NVMe targets may experience service interruptions. The requirement for local high privileges limits remote exploitation, but insider threats or compromised local accounts could trigger the crash. The absence of known exploits reduces immediate risk, but unpatched systems remain vulnerable to accidental or intentional crashes. European organizations with strict uptime SLAs and regulatory requirements for service continuity should prioritize patching to avoid availability disruptions.
Mitigation Recommendations
1. Apply the official Linux kernel patches that address CVE-2021-47130 as soon as possible. Ensure kernel versions are updated to include the fix that correctly handles p2p memory freeing in the nvmet driver. 2. Audit and monitor systems running the nvmet subsystem and using peer-to-peer memory features to identify vulnerable kernel versions. 3. Restrict local access to trusted administrators only, minimizing the risk of local exploitation by unauthorized users. 4. For environments not requiring NVMe target or p2p memory features, consider disabling the nvmet module or related kernel options to reduce the attack surface. 5. Implement robust monitoring and alerting for kernel crashes and BUG() invocations to detect exploitation attempts or accidental triggers early. 6. Test kernel updates in staging environments to ensure compatibility and stability before deployment in production, especially in storage-critical systems. 7. Maintain up-to-date backups and disaster recovery plans to mitigate the impact of potential service disruptions caused by kernel crashes.
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
- 2024-03-04T18:12:48.840Z
- Cisa Enriched
- true
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 682d9834c4522896dcbe9e0b
Added to database: 5/21/2025, 9:09:08 AM
Last enriched: 6/26/2025, 7:51:40 PM
Last updated: 8/5/2025, 6:58:34 PM
Views: 13
Related Threats
CVE-2025-9028: SQL Injection in code-projects Online Medicine Guide
MediumCVE-2025-26709: CWE-200 Exposure of Sensitive Information to an Unauthorized Actor in ZTE F50
MediumCVE-2025-9027: SQL Injection in code-projects Online Medicine Guide
MediumCVE-2025-9026: OS Command Injection in D-Link DIR-860L
MediumCVE-2025-9025: SQL Injection in code-projects Simple Cafe Ordering System
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.