CVE-2022-50074
📋 TL;DR
This is a memory leak vulnerability in the AppArmor Linux kernel security module. When copy_from_user fails in aa_simple_write_to_buffer(), the memory management struct isn't properly freed, causing a memory leak. This affects Linux systems using AppArmor for mandatory access control.
💻 Affected Systems
- Linux Kernel
📦 What is this software?
Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →⚠️ Risk & Real-World Impact
Worst Case
Sustained exploitation could lead to kernel memory exhaustion, causing system instability, denial of service, or potential kernel crashes.
Likely Case
Memory leak gradually consumes kernel memory over time, potentially leading to performance degradation or system instability.
If Mitigated
With proper monitoring and memory limits, impact is limited to minor performance issues before detection.
🎯 Exploit Status
Requires local access and ability to trigger AppArmor policy operations that fail copy_from_user.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Kernel versions containing the fix commits (e.g., stable commits listed in references)
Vendor Advisory: https://git.kernel.org/stable/c/417ea9fe972d2654a268ad66e89c8fcae67017c3
Restart Required: Yes
Instructions:
1. Update Linux kernel to patched version. 2. Reboot system to load new kernel. 3. Verify AppArmor is functioning correctly post-update.
🔧 Temporary Workarounds
Disable AppArmor
linuxTemporarily disable AppArmor to prevent exploitation of this vulnerability
sudo systemctl stop apparmor
sudo systemctl disable apparmor
Restrict AppArmor policy operations
linuxLimit which users can modify AppArmor policies
sudo chmod 640 /etc/apparmor.d/*
sudo chown root:root /etc/apparmor.d/*
🧯 If You Can't Patch
- Implement kernel memory monitoring to detect unusual memory consumption patterns
- Restrict local user access to systems and implement least privilege principles
🔍 How to Verify
Check if Vulnerable:
Check kernel version and verify if AppArmor is enabled: uname -r && aa-status
Check Version:
uname -r
Verify Fix Applied:
Verify kernel version is updated and test AppArmor functionality remains intact
📡 Detection & Monitoring
Log Indicators:
- Kernel OOM (Out of Memory) messages in dmesg
- AppArmor audit logs showing policy operation failures
Network Indicators:
- None - local vulnerability only
SIEM Query:
source="kernel" AND ("out of memory" OR "oom") AND process="apparmor"
🔗 References
- https://git.kernel.org/stable/c/417ea9fe972d2654a268ad66e89c8fcae67017c3
- https://git.kernel.org/stable/c/6500eb3a48ac221051b1791818a1ac74744ef617
- https://git.kernel.org/stable/c/6583edbf459de2e06b9759f264c0ae27e452b97a
- https://git.kernel.org/stable/c/7db182a2ebeefded86fea542fcc5d6a68bb77f58
- https://git.kernel.org/stable/c/8aab4295582eb397a125d2788b829fa62b88dbf7
- https://git.kernel.org/stable/c/bf7ebebce2c25071c719fd8a2f1307e0c243c2d7