# CVE-2022-50751: configfs: fix possible memory leak in configfs\_create\_dir()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.29% (percentile 14, 2026-11-26)
- **Published:** 2025-12-24T13:05:46.159Z
- **Modified:** 2026-11-10T12:10:00.177Z

## Who should check

- Anyone running Linux \>= 7063fbf2261194f72ee75afca67b3b38b554b5fa, \< 90c38f57a821499391526b15cc944c265bd24e48; \>= 7063fbf2261194f72ee75afca67b3b38b554b5fa, \< 74ac7c9ee2d486c501e7864c903f5098fc477acd; \>= 7063fbf2261194f72ee75afca67b3b38b554b5fa, \< 07f82dca112262b169bec0001378126439cab776; \>= 7063fbf2261194f72ee75afca67b3b38b554b5fa, \< 8bc77754224a2c8581727ffe2e958119b4e27c8f; \>= 7063fbf2261194f72ee75afca67b3b38b554b5fa, \< c72eb6e6e49a71f7598740786568fafdd013a227; \>= 7063fbf2261194f72ee75afca67b3b38b554b5fa, \< c65234b283a65cfbfc94619655e820a5e55199eb
- Anyone running Linux 2.6.16

## Description

In the Linux kernel, the following vulnerability has been resolved:

configfs: fix possible memory leak in configfs\_create\_dir()

kmemleak reported memory leaks in configfs\_create\_dir():

unreferenced object 0xffff888009f6af00 (size 192):
  comm "modprobe", pid 3777, jiffies 4295537735 (age 233.784s)
  backtrace:
    kmem\_cache\_alloc (mm/slub.c:3250 mm/slub.c:3256 mm/slub.c:3263 mm/slub.c:3273)
    new\_fragment (./include/linux/slab.h:600 fs/configfs/dir.c:163)
    configfs\_register\_subsystem (fs/configfs/dir.c:1857)
    basic\_write (drivers/hwtracing/stm/p\_basic.c:14) stm\_p\_basic
    do\_one\_initcall (init/main.c:1296)
    do\_init\_module (kernel/module/main.c:2455)
    ...

unreferenced object 0xffff888003ba7180 (size 96):
  comm "modprobe", pid 3777, jiffies 4295537735 (age 233.784s)
  backtrace:
    kmem\_cache\_alloc (mm/slub.c:3250 mm/slub.c:3256 mm/slub.c:3263 mm/slub.c:3273)
    configfs\_new\_dirent (./include/linux/slab.h:723 fs/configfs/dir.c:194)
    configfs\_make\_dirent (fs/configfs/dir.c:248)
    configfs\_create\_dir (fs/configfs/dir.c:296)
    configfs\_attach\_group.isra.28 (fs/configfs/dir.c:816 fs/configfs/dir.c:852)
    configfs\_register\_subsystem (fs/configfs/dir.c:1881)
    basic\_write (drivers/hwtracing/stm/p\_basic.c:14) stm\_p\_basic
    do\_one\_initcall (init/main.c:1296)
    do\_init\_module (kernel/module/main.c:2455)
    ...

This is because the refcount is not correct in configfs\_make\_dirent().
For normal stage, the refcount is changing as:

configfs\_register\_subsystem()
  configfs\_create\_dir()
    configfs\_make\_dirent()
      configfs\_new\_dirent() \# set s\_count = 1
      dentry-\>d\_fsdata = configfs\_get(sd); \# s\_count = 2
...
configfs\_unregister\_subsystem()
  configfs\_remove\_dir()
    remove\_dir()
      configfs\_remove\_dirent() \# s\_count = 1
    dput() ...
      \*dentry\_unlink\_inode()\*
        configfs\_d\_iput() \# s\_count = 0, release

However, if we failed in configfs\_create():

configfs\_register\_subsystem()
  configfs\_create\_dir()
    configfs\_make\_dirent() \# s\_count = 2
    ...
    configfs\_create() \# fail
    -\>out\_remove:
    configfs\_remove\_dirent(dentry)
      configfs\_put(sd) \# s\_count = 1
      return PTR\_ERR(inode);

There is no inode in the error path, so the configfs\_d\_iput() is lost
and makes sd and fragment memory leaked.

To fix this, when we failed in configfs\_create(), manually call
configfs\_put(sd) to keep the refcount correct.

## Affected and fixed versions

- Linux: \>= 7063fbf2261194f72ee75afca67b3b38b554b5fa, \< 90c38f57a821499391526b15cc944c265bd24e48; \>= 7063fbf2261194f72ee75afca67b3b38b554b5fa, \< 74ac7c9ee2d486c501e7864c903f5098fc477acd; \>= 7063fbf2261194f72ee75afca67b3b38b554b5fa, \< 07f82dca112262b169bec0001378126439cab776; \>= 7063fbf2261194f72ee75afca67b3b38b554b5fa, \< 8bc77754224a2c8581727ffe2e958119b4e27c8f; \>= 7063fbf2261194f72ee75afca67b3b38b554b5fa, \< c72eb6e6e49a71f7598740786568fafdd013a227; \>= 7063fbf2261194f72ee75afca67b3b38b554b5fa, \< c65234b283a65cfbfc94619655e820a5e55199eb (cvelist)
- Linux: 2.6.16 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-50751. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-50751.md
Affected: Linux >= 7063fbf2261194f72ee75afca67b3b38b554b5fa, < 90c38f57a821499391526b15cc944c265bd24e48; >= 7063fbf2261194f72ee75afca67b3b38b554b5fa, < 74ac7c9ee2d486c501e7864c903f5098fc477acd; >= 7063fbf2261194f72ee75afca67b3b38b554b5fa, < 07f82dca112262b169bec0001378126439cab776; >= 7063fbf2261194f72ee75af…
Fixed in: Linux 90c38f57a821499391526b15cc944c265bd24e48, Linux 74ac7c9ee2d486c501e7864c903f5098fc477acd, Linux 07f82dca112262b169bec0001378126439cab776, Linux 8bc77754224a2c8581727ffe2e958119b4e27c8f

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-50751 being exploited?

There is no confirmed exploitation: CVE-2022-50751 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.29% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-50751?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2022-50751?

Linux \>= 7063fbf2261194f72ee75afca67b3b38b554b5fa, \< 90c38f57a821499391526b15cc944c265bd24e48; \>= 7063fbf2261194f72ee75afca67b3b38b554b5fa, \< 74ac7c9ee2d486c501e7864c903f5098fc477acd; \>= 7063fbf2261194f72ee75afca67b3b38b554b5fa, \< 07f82dca112262b169bec0001378126439cab776; \>= 7063fbf2261194f72ee75afca67b3b38b554b5fa, \< 8bc77754224a2c8581727ffe2e958119b4e27c8f; \>= 7063fbf2261194f72ee75afca67b3b38b554b5fa, \< c72eb6e6e49a71f7598740786568fafdd013a227; \>= 7063fbf2261194f72ee75afca67b3b38b554b5fa, \< c65234b283a65cfbfc94619655e820a5e55199eb; Linux 2.6.16.

### Is there a fix for CVE-2022-50751?

Yes. Fixed in Linux 90c38f57a821499391526b15cc944c265bd24e48, Linux 74ac7c9ee2d486c501e7864c903f5098fc477acd, Linux 07f82dca112262b169bec0001378126439cab776, Linux 8bc77754224a2c8581727ffe2e958119b4e27c8f. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2022-50751?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/90c38f57a821499391526b15cc944c265bd24e48>
- other: <https://git.kernel.org/stable/c/74ac7c9ee2d486c501e7864c903f5098fc477acd>
- other: <https://git.kernel.org/stable/c/07f82dca112262b169bec0001378126439cab776>
- other: <https://git.kernel.org/stable/c/8bc77754224a2c8581727ffe2e958119b4e27c8f>
- other: <https://git.kernel.org/stable/c/c72eb6e6e49a71f7598740786568fafdd013a227>
- other: <https://git.kernel.org/stable/c/c65234b283a65cfbfc94619655e820a5e55199eb>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-50751>

HTML: <https://flawdb.com/CVE-2022-50751> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-50751>
