Skip to content
Heist/ feed
Back to feed
UnratedFix available

driver core: fix resource leak in device_add()

Type: advisorySources: OSV

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: 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 kobject_add_internal failed for mac80211_hwsim with -EEXIST, don't try to register things with the same name in the same directory.

Products
Kernel
Affected versions
Not specified
Fixed versions
5.15.99, 6.1.16, 6.2.3
CVEs
CVE-2023-53594
Confirmed fixed CVEs
Not specified
Updated in this feed
5 Nov 2026, 02:01 UTC · Revision 1

Source evidence

driver core: fix resource leak in device_add()

core-osv · Original source

Published 4 Oct 2025, 15:44 UTC

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: 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 kobject_add_internal failed for mac80211_hwsim with -EEXIST, don't try to register things with the same name in the same directory.

osv:CVE-2023-53594

Kernel

Fixed versions: 5.15.99, 6.1.16, 6.2.3

Complete source record
{
  "id": "4dacf1dbf34448844817ab65c8bd82f9b38969c71741de91e244237730a9b76d",
  "url": "https://osv.dev/vulnerability/CVE-2023-53594",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "driver core: fix resource leak in device_add()",
    "summary": "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: 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 kobject_add_internal failed for mac80211_hwsim with -EEXIST, don't try to register things with the same name in the same directory.",
    "evidence": "osv:CVE-2023-53594",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "5.15.99",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.1.16",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.2.3",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2023-53594",
      "aliases": [
        "CVE-2023-53594"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "cebf8fd16900fdfd58c0028617944f808f97fe50"
                },
                {
                  "fixed": "8d389e363075c2e1deb84a560686ea92123e4b8b"
                },
                {
                  "fixed": "d1dbff10c6cd3b43457f3efd3c9c4950009635bf"
                },
                {
                  "fixed": "f39d21154db87545d8f0b25d13c326f37cc32239"
                },
                {
                  "fixed": "6977b1a5d67097eaa4d02b0c126c04cc6e8917c0"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "3.10.105"
                },
                {
                  "fixed": "3.11"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "3.12.70"
                },
                {
                  "fixed": "3.13"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "4.4.40"
                },
                {
                  "fixed": "4.5"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "4.8.16"
                },
                {
                  "fixed": "4.9"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "e7f6e3c9db4b6f259c89fd05728d024ab32acd71"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "a93a63333dbdb182b87e8cc99df8b4474f867acb"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "37de955c11b59050346e530143c20b10b4846527"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "645897231f960590220144b06d1f994b7eb88326"
                }
              ]
            }
          ],
          "versions": [
            "v3.10.108",
            "v3.10.107",
            "v3.10.106",
            "v3.10.105",
            "v3.12.74",
            "v3.12.73",
            "v3.12.72",
            "v3.12.71",
            "v3.12.70",
            "v4.4.302",
            "v4.4.301",
            "v4.4.300",
            "v4.4.299",
            "v4.4.298",
            "v4.4.297",
            "v4.4.296",
            "v4.4.295",
            "v4.4.294",
            "v4.4.293",
            "v4.4.292",
            "v4.4.291",
            "v4.4.290",
            "v4.4.289",
            "v4.4.288",
            "v4.4.287",
            "v4.4.286",
            "v4.4.285",
            "v4.4.284",
            "v4.4.283",
            "v4.4.282",
            "v4.4.281",
            "v4.4.280",
            "v4.4.279",
            "v4.4.278",
            "v4.4.277",
            "v4.4.276",
            "v4.4.275",
            "v4.4.274",
            "v4.4.273",
            "v4.4.272",
            "v4.4.271",
            "v4.4.270",
            "v4.4.269",
            "v4.4.268",
            "v4.4.267",
            "v4.4.266",
            "v4.4.265",
            "v4.4.264",
            "v4.4.263",
            "v4.4.262",
            "v4.4.261",
            "v4.4.260",
            "v4.4.259",
            "v4.4.258",
            "v4.4.257",
            "v4.4.256",
            "v4.4.255",
            "v4.4.254",
            "v4.4.253",
            "v4.4.252",
            "v4.4.251",
            "v4.4.250",
            "v4.4.249",
            "v4.4.248",
            "v4.4.247",
            "v4.4.246",
            "v4.4.245",
            "v4.4.244",
            "v4.4.243",
            "v4.4.242",
            "v4.4.241",
            "v4.4.240",
            "v4.4.239",
            "v4.4.238",
            "v4.4.237",
            "v4.4.236",
            "v4.4.235",
            "v4.4.234",
            "v4.4.233",
            "v4.4.232",
            "v4.4.231",
            "v4.4.230",
            "v4.4.229",
            "v4.4.228",
            "v4.4.227",
            "v4.4.226",
            "v4.4.225",
            "v4.4.224",
            "v4.4.223",
            "v4.4.222",
            "v4.4.221",
            "v4.4.220",
            "v4.4.219",
            "v4.4.218",
            "v4.4.217",
            "v4.4.216",
            "v4.4.215",
            "v4.4.214",
            "v4.4.213",
            "v4.4.212",
            "v4.4.211",
            "v4.4.210",
            "v4.4.209",
            "v4.4.208",
            "v4.4.207",
            "v4.4.206",
            "v4.4.205",
            "v4.4.204",
            "v4.4.203",
            "v4.4.202",
            "v4.4.201",
            "v4.4.200",
            "v4.4.199",
            "v4.4.198",
            "v4.4.197",
            "v4.4.196",
            "v4.4.195",
            "v4.4.194",
            "v4.4.193",
            "v4.4.192",
            "v4.4.191",
            "v4.4.190",
            "v4.4.189",
            "v4.4.188",
            "v4.4.187",
            "v4.4.186",
            "v4.4.185",
            "v4.4.184",
            "v4.4.183",
            "v4.4.182",
            "v4.4.181",
            "v4.4.180",
            "v4.4.179",
            "v4.4.178",
            "v4.4.177",
            "v4.4.176",
            "v4.4.175",
            "v4.4.174",
            "v4.4.173",
            "v4.4.172",
            "v4.4.171",
            "v4.4.170",
            "v4.4.169",
            "v4.4.168",
            "v4.4.167",
            "v4.4.166",
            "v4.4.165",
            "v4.4.164",
            "v4.4.163",
            "v4.4.162",
            "v4.4.161",
            "v4.4.160",
            "v4.4.159",
            "v4.4.158",
            "v4.4.157",
            "v4.4.156",
            "v4.4.155",
            "v4.4.154",
            "v4.4.153",
            "v4.4.152",
            "v4.4.151",
            "v4.4.150",
            "v4.4.149",
            "v4.4.148",
            "v4.4.147",
            "v4.4.146",
            "v4.4.145",
            "v4.4.144",
            "v4.4.143",
            "v4.4.142",
            "v4.4.141",
            "v4.4.140",
            "v4.4.139",
            "v4.4.138",
            "v4.4.137",
            "v4.4.136",
            "v4.4.135",
            "v4.4.134",
            "v4.4.133",
            "v4.4.132",
            "v4.4.131",
            "v4.4.130",
            "v4.4.129",
            "v4.4.128",
            "v4.4.127",
            "v4.4.126",
            "v4.4.125",
            "v4.4.124",
            "v4.4.123",
            "v4.4.122",
            "v4.4.121",
            "v4.4.120",
            "v4.4.119",
            "v4.4.118",
            "v4.4.117",
            "v4.4.116",
            "v4.4.115",
            "v4.4.114",
            "v4.4.113",
            "v4.4.112",
            "v4.4.111",
            "v4.4.110",
            "v4.4.109",
            "v4.4.108",
            "v4.4.107",
            "v4.4.106",
            "v4.4.105",
            "v4.4.104",
            "v4.4.103",
            "v4.4.102",
            "v4.4.101",
            "v4.4.100",
            "v4.4.99",
            "v4.4.98",
            "v4.4.97",
            "v4.4.96",
            "v4.4.95",
            "v4.4.94",
            "v4.4.93",
            "v4.4.92",
            "v4.4.91",
            "v4.4.90",
            "v4.4.89",
            "v4.4.88",
            "v4.4.87",
            "v4.4.86",
            "v4.4.85",
            "v4.4.84",
            "v4.4.83",
            "v4.4.82",
            "v4.4.81",
            "v4.4.80",
            "v4.4.79",
            "v4.4.78",
            "v4.4.77",
            "v4.4.76",
            "v4.4.75",
            "v4.4.74",
            "v4.4.73",
            "v4.4.72",
            "v4.4.71",
            "v4.4.70",
            "v4.4.69",
            "v4.4.68",
            "v4.4.67",
            "v4.4.66",
            "v4.4.65",
            "v4.4.64",
            "v4.4.63",
            "v4.4.62",
            "v4.4.61",
            "v4.4.60",
            "v4.4.59",
            "v4.4.58",
            "v4.4.57",
            "v4.4.56",
            "v4.4.55",
            "v4.4.54",
            "v4.4.53",
            "v4.4.52",
            "v4.4.51",
            "v4.4.50",
            "v4.4.49",
            "v4.4.48",
            "v4.4.47",
            "v4.4.46",
            "v4.4.45",
            "v4.4.44",
            "v4.4.43",
            "v4.4.42",
            "v4.4.41",
            "v4.4.40",
            "v4.8.17",
            "v4.8.16"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-53594.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.9.0"
                },
                {
                  "fixed": "5.15.99"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.16.0"
                },
                {
                  "fixed": "6.1.16"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.2.0"
                },
                {
                  "fixed": "6.2.3"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-53594.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:41.938288645Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/6977b1a5d67097eaa4d02b0c126c04cc6e8917c0",
        "https://git.kernel.org/stable/c/8d389e363075c2e1deb84a560686ea92123e4b8b",
        "https://git.kernel.org/stable/c/d1dbff10c6cd3b43457f3efd3c9c4950009635bf",
        "https://git.kernel.org/stable/c/f39d21154db87545d8f0b25d13c326f37cc32239",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/53xxx/CVE-2023-53594.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2023-53594",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/53xxx/CVE-2023-53594.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2023-53594",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 509303,
  "published_at": "2025-10-04T15:44:07.533+00:00"
}