# CVE-2022-50466: fs/binfmt\_elf: Fix memory leak in load\_elf\_binary()

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.22% (percentile 7, 2026-11-26)
- **CWE:** CWE-401
- **Published:** 2025-10-01T11:45:37.376Z
- **Modified:** 2026-11-05T21:17:00.160Z

## Who should check

- Anyone running Linux \>= 0693ffebcfe5ac7b31f63ad54587007f7d96fb7b, \< 706215300411d48db6b51a5832b872632a84bbc1; \>= 0693ffebcfe5ac7b31f63ad54587007f7d96fb7b, \< 265b6fb780f57d10449a40e94219b28fa52479cc; \>= 0693ffebcfe5ac7b31f63ad54587007f7d96fb7b, \< acd9b4914f1c5928c7ae8ebc623d6291eb1a573a; \>= 0693ffebcfe5ac7b31f63ad54587007f7d96fb7b, \< 594d2a14f2168c09b13b114c3d457aa939403e52
- Anyone running Linux 5.7

## Description

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

fs/binfmt\_elf: Fix memory leak in load\_elf\_binary()

There is a memory leak reported by kmemleak:

  unreferenced object 0xffff88817104ef80 (size 224):
    comm "xfs\_admin", pid 47165, jiffies 4298708825 (age 1333.476s)
    hex dump (first 32 bytes):
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      60 a8 b3 00 81 88 ff ff a8 10 5a 00 81 88 ff ff  \`.........Z.....
    backtrace:
      \[\<ffffffff819171e1\>\] \_\_alloc\_file+0x21/0x250
      \[\<ffffffff81918061\>\] alloc\_empty\_file+0x41/0xf0
      \[\<ffffffff81948cda\>\] path\_openat+0xea/0x3d30
      \[\<ffffffff8194ec89\>\] do\_filp\_open+0x1b9/0x290
      \[\<ffffffff8192660e\>\] do\_open\_execat+0xce/0x5b0
      \[\<ffffffff81926b17\>\] open\_exec+0x27/0x50
      \[\<ffffffff81a69250\>\] load\_elf\_binary+0x510/0x3ed0
      \[\<ffffffff81927759\>\] bprm\_execve+0x599/0x1240
      \[\<ffffffff8192a997\>\] do\_execveat\_common.isra.0+0x4c7/0x680
      \[\<ffffffff8192b078\>\] \_\_x64\_sys\_execve+0x88/0xb0
      \[\<ffffffff83bbf0a5\>\] do\_syscall\_64+0x35/0x80

If "interp\_elf\_ex" fails to allocate memory in load\_elf\_binary(),
the program will take the "out\_free\_ph" error handing path,
resulting in "interpreter" file resource is not released.

Fix it by adding an error handing path "out\_free\_file", which will
release the file resource when "interp\_elf\_ex" failed to allocate
memory.

## Affected and fixed versions

- Linux: \>= 0693ffebcfe5ac7b31f63ad54587007f7d96fb7b, \< 706215300411d48db6b51a5832b872632a84bbc1; \>= 0693ffebcfe5ac7b31f63ad54587007f7d96fb7b, \< 265b6fb780f57d10449a40e94219b28fa52479cc; \>= 0693ffebcfe5ac7b31f63ad54587007f7d96fb7b, \< acd9b4914f1c5928c7ae8ebc623d6291eb1a573a; \>= 0693ffebcfe5ac7b31f63ad54587007f7d96fb7b, \< 594d2a14f2168c09b13b114c3d457aa939403e52 (cvelist)
- Linux: 5.7 (cvelist)

## Mitigation

- Upgrade Linux to 594d2a14f2168c09b13b114c3d457aa939403e52 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2022-50466.md
Affected: Linux >= 0693ffebcfe5ac7b31f63ad54587007f7d96fb7b, < 706215300411d48db6b51a5832b872632a84bbc1; >= 0693ffebcfe5ac7b31f63ad54587007f7d96fb7b, < 265b6fb780f57d10449a40e94219b28fa52479cc; >= 0693ffebcfe5ac7b31f63ad54587007f7d96fb7b, < acd9b4914f1c5928c7ae8ebc623d6291eb1a573a; >= 0693ffebcfe5ac7b31f63ad…
Fixed in: Linux 706215300411d48db6b51a5832b872632a84bbc1, Linux 265b6fb780f57d10449a40e94219b28fa52479cc, Linux 594d2a14f2168c09b13b114c3d457aa939403e52

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-50466 being exploited?

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

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

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= 0693ffebcfe5ac7b31f63ad54587007f7d96fb7b, \< 706215300411d48db6b51a5832b872632a84bbc1; \>= 0693ffebcfe5ac7b31f63ad54587007f7d96fb7b, \< 265b6fb780f57d10449a40e94219b28fa52479cc; \>= 0693ffebcfe5ac7b31f63ad54587007f7d96fb7b, \< acd9b4914f1c5928c7ae8ebc623d6291eb1a573a; \>= 0693ffebcfe5ac7b31f63ad54587007f7d96fb7b, \< 594d2a14f2168c09b13b114c3d457aa939403e52; Linux 5.7.

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

Yes. Fixed in Linux 706215300411d48db6b51a5832b872632a84bbc1, Linux 265b6fb780f57d10449a40e94219b28fa52479cc, Linux 594d2a14f2168c09b13b114c3d457aa939403e52. Upgrade Linux to 594d2a14f2168c09b13b114c3d457aa939403e52 or later.

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

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

- patch: <https://git.kernel.org/stable/c/706215300411d48db6b51a5832b872632a84bbc1>
- patch: <https://git.kernel.org/stable/c/265b6fb780f57d10449a40e94219b28fa52479cc>
- patch: <https://git.kernel.org/stable/c/acd9b4914f1c5928c7ae8ebc623d6291eb1a573a>
- patch: <https://git.kernel.org/stable/c/594d2a14f2168c09b13b114c3d457aa939403e52>

## 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-50466>

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