CVE-2022-0995 Overview
An out-of-bounds (OOB) memory write flaw was found in the Linux kernel's watch_queue event notification subsystem. This vulnerability (CWE-787: Out-of-bounds Write) can overwrite parts of the kernel state, potentially allowing a local user to gain privileged access or cause a denial of service on the system. The watch_queue subsystem is used for event notification mechanisms in the kernel, and improper bounds checking during filter operations enables attackers to corrupt adjacent memory regions.
Critical Impact
Local attackers can exploit this vulnerability to overwrite kernel memory, potentially achieving privilege escalation to root or causing system-wide denial of service.
Affected Products
- Linux Kernel (versions prior to patch, including 5.17 RC releases)
- Fedora 35
- NetApp H-Series Storage Systems (H300E, H300S, H410C, H410S, H500E, H500S, H610C, H610S, H615C, H700E, H700S)
Discovery Timeline
- 2022-03-25 - CVE-2022-0995 published to NVD
- 2024-11-21 - Last updated in NVD database
Technical Details for CVE-2022-0995
Vulnerability Analysis
The vulnerability exists in the Linux kernel's watch_queue event notification subsystem, specifically in the filter handling logic. When a user-space application sets up a watch queue filter, the kernel fails to properly validate the filter type value against the allocated buffer boundaries. This allows an attacker to specify a filter type that exceeds the allocated bitmap size, resulting in an out-of-bounds write operation.
The watch_queue mechanism is part of the kernel's general notification system that allows user-space processes to receive notifications about various kernel events. The filtering mechanism uses a bitmap to track which event types should be delivered to the watching process. However, insufficient validation of user-supplied filter parameters enables writing beyond the intended memory region.
Since this requires local access and low privileges to exploit, attackers with basic user-level access to the system can leverage this flaw to corrupt kernel memory structures. Successful exploitation could overwrite critical kernel data structures, enabling privilege escalation from an unprivileged user to root, or cause kernel panics resulting in denial of service.
Root Cause
The root cause is improper bounds checking in the watch_queue filter setup code. When processing user-supplied filter parameters, the kernel does not adequately validate that the specified filter type falls within the bounds of the allocated type filter bitmap. This allows an attacker to specify an out-of-bounds type value, causing a write operation to memory locations outside the intended buffer.
The vulnerable code path fails to verify that type_filter parameters stay within the allocated size before performing bitwise operations on the filter bitmap. This classic out-of-bounds write condition (CWE-787) enables corruption of adjacent kernel memory.
Attack Vector
The attack requires local access to the system with standard user privileges. An attacker can exploit this vulnerability through the following approach:
- Create a watch_queue pipe using the pipe2() system call with O_NOTIFICATION_PIPE flag
- Set up a malicious filter with an out-of-bounds type value using the ioctl() system call
- The kernel processes the filter without proper bounds checking
- Adjacent kernel memory is corrupted, potentially including security-critical structures
- Depending on what memory is overwritten, the attacker may achieve privilege escalation or trigger a kernel panic
The exploitation technique leverages the fact that the filter bitmap allocation is of a fixed size, but the user-controlled type parameter is not validated against this size, allowing writes beyond the buffer boundary.
Detection Methods for CVE-2022-0995
Indicators of Compromise
- Unexpected kernel crashes or panics related to memory corruption in watch_queue subsystem
- Suspicious processes attempting to create notification pipes with unusual filter configurations
- Abnormal privilege escalation events from unprivileged users to root
- Audit logs showing frequent ioctl() calls on O_NOTIFICATION_PIPE file descriptors
- Memory corruption errors in kernel logs referencing the notification subsystem
Detection Strategies
- Monitor for unusual pipe2() system calls with O_NOTIFICATION_PIPE flags from untrusted processes
- Implement kernel-level auditing for ioctl() operations on watch queue file descriptors
- Deploy SentinelOne Singularity to detect behavioral anomalies associated with privilege escalation attempts
- Use kernel integrity monitoring to detect unauthorized modifications to kernel memory structures
Monitoring Recommendations
- Enable comprehensive audit logging for system calls related to pipe creation and ioctl() operations
- Configure SentinelOne agents to monitor for exploitation attempts targeting kernel vulnerabilities
- Implement file integrity monitoring on kernel modules and system libraries
- Set up alerts for unexpected root privilege acquisitions from non-administrative accounts
How to Mitigate CVE-2022-0995
Immediate Actions Required
- Update the Linux kernel to a patched version containing commit 93ce93587d36493f2f86921fa79921b3cba63fbb
- Review and apply vendor-specific patches from distribution maintainers (Red Hat, Fedora, etc.)
- For NetApp systems, apply firmware updates as specified in NetApp Security Advisory NTAP-20220429-0001
- Limit local system access to trusted users until patching is complete
- Consider restricting access to pipe2() with notification pipe capabilities using seccomp filters
Patch Information
The vulnerability has been addressed in the Linux kernel through commit 93ce93587d36493f2f86921fa79921b3cba63fbb. This patch adds proper bounds checking to ensure that filter type values cannot exceed the allocated bitmap size. Organizations should update to kernel versions containing this fix.
For detailed bug tracking information, refer to the Red Hat Bug Report #2063786.
Workarounds
- Restrict local system access to only trusted administrators until patching can be completed
- Use seccomp profiles to block or filter pipe2() system calls with O_NOTIFICATION_PIPE flag for untrusted applications
- Consider disabling or removing kernel modules associated with the watch_queue subsystem if not required for operations
- Deploy application allowlisting to prevent unauthorized binaries from executing on vulnerable systems
# Check current kernel version
uname -r
# Verify if the patch is applied (look for commit in kernel source)
grep -r "watch_queue" /usr/src/linux/kernel/watch_queue.c
# Example seccomp filter to restrict notification pipe creation (application-specific)
# Consult your distribution's documentation for seccomp implementation details
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


