In the Linux kernel, the following vulnerability has been resolved:
driver core: fix resource leak in device_add()
When calling kobjectadd() failed in deviceadd(), it will call cleanupgluedir() 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: deviceadd() getdeviceparent() classdircreateandadd() kobjectadd() //kobjectget() ... dev->kobj.parent = kobj; ... kobjectadd() //failed, but set dev->kobj.parent = NULL ... gluedir = getgluedir(dev) //gluedir = NULL, and goto //"Error" label ... cleanupgluedir() //becaues gluedir is NULL, not call //kobjectput()
The preceding problem may cause insmod mac80211hwsim.ko to failed. sysfs: cannot create duplicate filename '/devices/virtual/mac80211hwsim' Call Trace: <TASK> dumpstacklvl+0x8e/0xd1 sysfswarndup.cold+0x1c/0x29 sysfscreatedirns+0x224/0x280 kobjectaddinternal+0x2aa/0x880 kobjectadd+0x135/0x1a0 getdeviceparent+0x3d7/0x590 deviceadd+0x2aa/0x1cb0 devicecreategroupsvargs+0x1eb/0x260 devicecreate+0xdc/0x110 mac80211hwsimnewradio+0x31e/0x4790 [mac80211hwsim] initmac80211hwsim+0x48d/0x1000 [mac80211hwsim] dooneinitcall+0x10f/0x630 doinitmodule+0x19f/0x5e0 loadmodule+0x64b7/0x6eb0 _dosysfinitmodule+0x140/0x200 dosyscall64+0x35/0x80 entrySYSCALL64afterhwframe+0x46/0xb0 </TASK> kobjectaddinternal failed for mac80211hwsim with -EEXIST, don't try to register things with the same name in the same directory.
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/53xxx/CVE-2023-53594.json",
"cna_assigner": "Linux"
}"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2023-53594.json"
[
{
"id": "CVE-2023-53594-1a40b287",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f39d21154db87545d8f0b25d13c326f37cc32239",
"target": {
"file": "drivers/base/core.c",
"function": "device_add"
},
"digest": {
"function_hash": "145704936443974595930678926088396402016",
"length": 2993.0
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function"
},
{
"id": "CVE-2023-53594-2e425f16",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6977b1a5d67097eaa4d02b0c126c04cc6e8917c0",
"target": {
"file": "drivers/base/core.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"35927246523946469841423249862739272675",
"335808479256858384078102681077709333590",
"136347409656306552514222564554418877725",
"294570963688156527490304206680936017346"
]
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"id": "CVE-2023-53594-5378d860",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d1dbff10c6cd3b43457f3efd3c9c4950009635bf",
"target": {
"file": "drivers/base/core.c",
"function": "device_add"
},
"digest": {
"function_hash": "145704936443974595930678926088396402016",
"length": 2993.0
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function"
},
{
"id": "CVE-2023-53594-57624384",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8d389e363075c2e1deb84a560686ea92123e4b8b",
"target": {
"file": "drivers/base/core.c",
"function": "device_add"
},
"digest": {
"function_hash": "145704936443974595930678926088396402016",
"length": 2993.0
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function"
},
{
"id": "CVE-2023-53594-6f9cb548",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d1dbff10c6cd3b43457f3efd3c9c4950009635bf",
"target": {
"file": "drivers/base/core.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"35927246523946469841423249862739272675",
"335808479256858384078102681077709333590",
"136347409656306552514222564554418877725",
"294570963688156527490304206680936017346"
]
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"id": "CVE-2023-53594-b9c463d1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6977b1a5d67097eaa4d02b0c126c04cc6e8917c0",
"target": {
"file": "drivers/base/core.c",
"function": "device_add"
},
"digest": {
"function_hash": "253143567310586506921995989340382545341",
"length": 2935.0
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function"
},
{
"id": "CVE-2023-53594-f1b79eb7",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8d389e363075c2e1deb84a560686ea92123e4b8b",
"target": {
"file": "drivers/base/core.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"35927246523946469841423249862739272675",
"335808479256858384078102681077709333590",
"136347409656306552514222564554418877725",
"294570963688156527490304206680936017346"
]
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"id": "CVE-2023-53594-f80e5303",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f39d21154db87545d8f0b25d13c326f37cc32239",
"target": {
"file": "drivers/base/core.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"35927246523946469841423249862739272675",
"335808479256858384078102681077709333590",
"136347409656306552514222564554418877725",
"294570963688156527490304206680936017346"
]
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
}
]