{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2022-50751","id":"CVE-2022-50751","title":"configfs: fix possible memory leak in configfs_create_dir()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nconfigfs: fix possible memory leak in configfs_create_dir()\n\nkmemleak reported memory leaks in configfs_create_dir():\n\nunreferenced object 0xffff888009f6af00 (size 192):\n  comm \"modprobe\", pid 3777, jiffies 4295537735 (age 233.784s)\n  backtrace:\n    kmem_cache_alloc (mm/slub.c:3250 mm/slub.c:3256 mm/slub.c:3263 mm/slub.c:3273)\n  ","descriptionLong":"In the Linux kernel, the following vulnerability has been resolved:\n\nconfigfs: fix possible memory leak in configfs_create_dir()\n\nkmemleak reported memory leaks in configfs_create_dir():\n\nunreferenced object 0xffff888009f6af00 (size 192):\n  comm \"modprobe\", pid 3777, jiffies 4295537735 (age 233.784s)\n  backtrace:\n    kmem_cache_alloc (mm/slub.c:3250 mm/slub.c:3256 mm/slub.c:3263 mm/slub.c:3273)\n    new_fragment (./include/linux/slab.h:600 fs/configfs/dir.c:163)\n    configfs_register_subsystem (fs/configfs/dir.c:1857)\n    basic_write (drivers/hwtracing/stm/p_basic.c:14) stm_p_basic\n    do_one_initcall (init/main.c:1296)\n    do_init_module (kernel/module/main.c:2455)\n    ...\n\nunreferenced object 0xffff888003ba7180 (size 96):\n  comm \"modprobe\", pid 3777, jiffies 4295537735 (age 233.784s)\n  backtrace:\n    kmem_cache_alloc (mm/slub.c:3250 mm/slub.c:3256 mm/slub.c:3263 mm/slub.c:3273)\n    configfs_new_dirent (./include/linux/slab.h:723 fs/configfs/dir.c:194)\n    configfs_make_dirent (fs/configfs/dir.c:248)\n    configfs_create_dir (fs/configfs/dir.c:296)\n    configfs_attach_group.isra.28 (fs/configfs/dir.c:816 fs/configfs/dir.c:852)\n    configfs_register_subsystem (fs/configfs/dir.c:1881)\n    basic_write (drivers/hwtracing/stm/p_basic.c:14) stm_p_basic\n    do_one_initcall (init/main.c:1296)\n    do_init_module (kernel/module/main.c:2455)\n    ...\n\nThis is because the refcount is not correct in configfs_make_dirent().\nFor normal stage, the refcount is changing as:\n\nconfigfs_register_subsystem()\n  configfs_create_dir()\n    configfs_make_dirent()\n      configfs_new_dirent() # set s_count = 1\n      dentry->d_fsdata = configfs_get(sd); # s_count = 2\n...\nconfigfs_unregister_subsystem()\n  configfs_remove_dir()\n    remove_dir()\n      configfs_remove_dirent() # s_count = 1\n    dput() ...\n      *dentry_unlink_inode()*\n        configfs_d_iput() # s_count = 0, release\n\nHowever, if we failed in configfs_create():\n\nconfigfs_register_subsystem()\n  configfs_create_dir()\n    configfs_make_dirent() # s_count = 2\n    ...\n    configfs_create() # fail\n    ->out_remove:\n    configfs_remove_dirent(dentry)\n      configfs_put(sd) # s_count = 1\n      return PTR_ERR(inode);\n\nThere is no inode in the error path, so the configfs_d_iput() is lost\nand makes sd and fragment memory leaked.\n\nTo fix this, when we failed in configfs_create(), manually call\nconfigfs_put(sd) to keep the refcount correct.","published":"2025-12-24T13:05:46.159Z","updated":"2026-11-12T02:30:58.572307819Z","reserved":"2025-12-24T13:02:21.544Z","status":"Deferred","rejected":false,"assigner":"Linux","metric":null,"metrics":[],"rating":"unrated","products":["Linux"],"affectedProducts":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"7063fbf2261194f72ee75afca67b3b38b554b5fa","lessThan":"90c38f57a821499391526b15cc944c265bd24e48","status":"affected","versionType":"git"},{"version":"7063fbf2261194f72ee75afca67b3b38b554b5fa","lessThan":"74ac7c9ee2d486c501e7864c903f5098fc477acd","status":"affected","versionType":"git"},{"version":"7063fbf2261194f72ee75afca67b3b38b554b5fa","lessThan":"07f82dca112262b169bec0001378126439cab776","status":"affected","versionType":"git"},{"version":"7063fbf2261194f72ee75afca67b3b38b554b5fa","lessThan":"8bc77754224a2c8581727ffe2e958119b4e27c8f","status":"affected","versionType":"git"},{"version":"7063fbf2261194f72ee75afca67b3b38b554b5fa","lessThan":"c72eb6e6e49a71f7598740786568fafdd013a227","status":"affected","versionType":"git"},{"version":"7063fbf2261194f72ee75afca67b3b38b554b5fa","lessThan":"c65234b283a65cfbfc94619655e820a5e55199eb","status":"affected","versionType":"git"}],"platforms":[]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.16","status":"affected"},{"version":"0","lessThan":"2.6.16","status":"unaffected","versionType":"semver"},{"version":"5.4.229","lessThanOrEqual":"5.4.*","status":"unaffected","versionType":"semver"},{"version":"5.10.163","lessThanOrEqual":"5.10.*","status":"unaffected","versionType":"semver"},{"version":"5.15.86","lessThanOrEqual":"5.15.*","status":"unaffected","versionType":"semver"},{"version":"6.0.16","lessThanOrEqual":"6.0.*","status":"unaffected","versionType":"semver"},{"version":"6.1.2","lessThanOrEqual":"6.1.*","status":"unaffected","versionType":"semver"},{"version":"6.2","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}],"platforms":[]}],"packages":[],"cwes":[],"aliases":[],"references":[{"url":"https://git.kernel.org/stable/c/90c38f57a821499391526b15cc944c265bd24e48","tags":["web"]},{"url":"https://git.kernel.org/stable/c/74ac7c9ee2d486c501e7864c903f5098fc477acd","tags":["web"]},{"url":"https://git.kernel.org/stable/c/07f82dca112262b169bec0001378126439cab776","tags":["web"]},{"url":"https://git.kernel.org/stable/c/8bc77754224a2c8581727ffe2e958119b4e27c8f","tags":["web"]},{"url":"https://git.kernel.org/stable/c/c72eb6e6e49a71f7598740786568fafdd013a227","tags":["web"]},{"url":"https://git.kernel.org/stable/c/c65234b283a65cfbfc94619655e820a5e55199eb","tags":["web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50751.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50751","tags":["advisory"]},{"url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","tags":["package"]}],"patchReferenced":false,"fixAvailable":false,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":null,"epss":0.00251,"epssPercentile":0.16651,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2022-50751","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50751","ok":true,"note":"Deferred"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2022-50751","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2022-50751","ok":true,"note":"scored 2026-11-18"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}