CVE-2022-1998
Linux Kernel vulnerability analysis and mitigation

Overview

A use-after-free vulnerability (CVE-2022-1998) was discovered in the Linux kernel File System notify functionality, specifically in the way user triggers copyinforecordstouser() call to fail in copyeventtouser(). The vulnerability was introduced in Linux kernel version 5.13 and affects versions through 5.17-rc2 ([Kernel Commit](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/fs/notify/fanotify/fanotifyuser.c?h=v5.17&id=ee12595147ac1fbfb5bcb23837e26dd58d94b15d), OSS Security).

Technical details

The vulnerability stems from an error in the error handling code after fdinstall() call. When copyinforecordstouser() fails, the code erroneously calls putunusedfd(fd) and fput(f) on a file that was already populated by fdinstall(). This creates a scenario where a valid file descriptor remains pointing to an already released file, potentially leading to use-after-free conditions. The vulnerability has a CVSS score of 7.8 (High) with vector CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (NetApp Advisory).

Impact

The successful exploitation of this vulnerability could allow a local user to crash the system or potentially escalate their privileges. Additionally, it could lead to disclosure of sensitive information, modification of data, or cause a Denial of Service (DoS) condition (NetApp Advisory).

Mitigation and workarounds

The vulnerability was fixed by delaying the fdinstall() call until everything else has succeeded, as implemented in Linux kernel version 5.17. The fix was provided through commit ee12595147ac1fbfb5bcb23837e26dd58d94b15d ([Kernel Commit](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/fs/notify/fanotify/fanotifyuser.c?h=v5.17&id=ee12595147ac1fbfb5bcb23837e26dd58d94b15d)).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management