CVE-2022-0185 Overview
CVE-2022-0185 is a heap-based buffer overflow vulnerability discovered in the Linux kernel's Filesystem Context functionality. The flaw exists in the legacy_parse_param function, which fails to properly verify the length of supplied parameters when handling filesystems that do not support the Filesystem Context API. This causes the kernel to fall back to legacy parameter handling, where an attacker can trigger the overflow condition.
An unprivileged local user—when unprivileged user namespaces are enabled—or a user with namespaced CAP_SYS_ADMIN privilege can exploit this vulnerability to escalate their privileges on the system. This represents a significant local privilege escalation vector that has been actively exploited in the wild.
Critical Impact
This vulnerability enables local privilege escalation to root on vulnerable Linux systems. It has been added to CISA's Known Exploited Vulnerabilities catalog, indicating confirmed active exploitation.
Affected Products
- Linux Kernel (multiple versions)
- NetApp H410c Firmware
- NetApp H300s, H500s, H700s Firmware
- NetApp H300e, H500e, H700e Firmware
- NetApp H410s Firmware
Discovery Timeline
- 2022-02-11 - CVE-2022-0185 published to NVD
- 2025-11-06 - Last updated in NVD database
Technical Details for CVE-2022-0185
Vulnerability Analysis
This vulnerability affects the legacy_parse_param function within the Linux kernel's Filesystem Context subsystem. When a filesystem that does not support the newer Filesystem Context API is mounted, the kernel falls back to legacy parameter handling code. The vulnerable function fails to properly validate the length of parameters passed during this process, creating conditions for a heap-based buffer overflow.
The attack is local in nature and requires no user interaction. On systems where unprivileged user namespaces are enabled (a common configuration in many distributions), any local user can attempt exploitation. On systems without unprivileged user namespaces, an attacker would need to possess the CAP_SYS_ADMIN capability within a namespace to trigger the vulnerability.
The CWE classifications for this vulnerability include CWE-190 (Integer Overflow or Wraparound) and CWE-191 (Integer Underflow), indicating that the root cause involves improper handling of integer arithmetic that leads to the buffer overflow condition.
Root Cause
The root cause stems from insufficient bounds checking in the legacy_parse_param function. When processing filesystem mount parameters, the function does not adequately validate the length of input data before copying it into a fixed-size heap buffer. Integer overflow or underflow conditions in the length calculation allow an attacker to craft malicious input that bypasses size checks, resulting in heap memory corruption.
Attack Vector
The attack requires local access to the target system. An attacker must be able to execute code locally and interact with the filesystem mounting subsystem. The exploitation path involves:
- Creating or entering a user namespace (if unprivileged user namespaces are enabled)
- Attempting to mount a filesystem that triggers the legacy parameter handling path
- Supplying specially crafted parameters that cause the integer overflow/underflow
- Exploiting the resulting heap corruption to gain elevated privileges
Detailed technical analysis of the exploitation technique is available in the Will's Root CVE-2022-0185 Analysis and the GitHub CVE-2022-0185 Report.
Detection Methods for CVE-2022-0185
Indicators of Compromise
- Unexpected user namespace creation activity from non-administrative accounts
- Suspicious filesystem mount operations with unusually long or malformed parameters
- Kernel crash dumps or oops messages referencing legacy_parse_param or filesystem context functions
- Unexplained privilege escalation events where unprivileged users gain root access
Detection Strategies
- Monitor system calls related to user namespace creation (unshare, clone with CLONE_NEWUSER)
- Implement kernel audit rules to track mount and fsconfig system calls with anomalous parameters
- Deploy endpoint detection solutions capable of identifying heap corruption exploitation patterns
- Analyze kernel logs for memory corruption indicators or unexpected page faults in fs_context code paths
Monitoring Recommendations
- Enable and review kernel audit logs for filesystem-related operations
- Configure SentinelOne Singularity Platform for Linux kernel exploitation detection
- Monitor for processes attempting to load unusual or rarely-used filesystem types
- Track user namespace creation patterns and alert on deviations from baseline behavior
How to Mitigate CVE-2022-0185
Immediate Actions Required
- Update Linux kernel to a patched version immediately
- If patching is not immediately possible, disable unprivileged user namespaces as a temporary mitigation
- Review systems for indicators of compromise before and after patching
- Prioritize patching for internet-facing or multi-tenant systems where local access is possible
Patch Information
The Linux kernel team has addressed this vulnerability in commit 722d94847de2. Organizations should update to kernel versions that include this fix. The patch is available in the Linux Kernel Git Repository.
For NetApp products, refer to NetApp Security Advisory NTAP-20220225-0003 for firmware updates and specific remediation guidance.
Additional details on the vulnerability disclosure can be found in the Openwall OSS-Security Discussion.
Workarounds
- Disable unprivileged user namespaces by setting kernel.unprivileged_userns_clone=0 via sysctl
- Restrict local system access to trusted users only
- Implement mandatory access control (SELinux, AppArmor) policies to limit namespace operations
- Use container runtime security features to restrict namespace capabilities within containerized environments
# Disable unprivileged user namespaces (temporary workaround)
echo "kernel.unprivileged_userns_clone=0" | sudo tee /etc/sysctl.d/99-disable-unpriv-userns.conf
sudo sysctl -p /etc/sysctl.d/99-disable-unpriv-userns.conf
# Verify the setting is applied
sysctl kernel.unprivileged_userns_clone
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

