CVE-2022-50577
ima: Fix memory leak in __ima_inode_hash()
Check your servers for CVE-2022-50577
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2022-50577 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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).
Exploitation
EPSS 0.21%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 12.1% of all scored CVEs. Scores of 1 Dec 2026.
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from 280fe8367b0dc45b6ac5e04fad03e16e99540c0c, before c4df8cb38f139ed9f4296868c0a6f15a26e8c491 affected from 280fe8367b0dc45b6ac5e04fad03e16e99540c0c, before f375bcf69f58fd0744c9dfd1b6b891a27301d67b affected from 280fe8367b0dc45b6ac5e04fad03e16e99540c0c, before 8c1d6a050a0f16e0a9d32eaf53b965c77279c6f8
Other versions: unaffected
|
| Linux |
affected 5.18 unaffected before 5.18 unaffected from 6.0.18 up to and including 6.0.* unaffected from 6.1.4 up to and including 6.1.* unaffected 6.2 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2022-50577 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2022-50577
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2022-50577
trivy image --scanners vuln IMAGE | grep CVE-2022-50577
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/c4df8cb38f139ed9f4296868c0a6f15a26e8c491 git.kernel.org
- https://git.kernel.org/stable/c/f375bcf69f58fd0744c9dfd1b6b891a27301d67b git.kernel.org
- https://git.kernel.org/stable/c/8c1d6a050a0f16e0a9d32eaf53b965c77279c6f8 git.kernel.org
Source: the record CVE-2022-50577 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse