CVE-2022-50074

5.5 MEDIUM

📋 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

Products:
  • Linux Kernel
Versions: Specific kernel versions with vulnerable AppArmor code (check git commits for exact ranges)
Operating Systems: Linux distributions using AppArmor
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems with AppArmor enabled and configured. Many enterprise Linux distributions use AppArmor by default.

📦 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.

🌐 Internet-Facing: LOW - Requires local access and AppArmor policy manipulation.
🏢 Internal Only: MEDIUM - Local users or processes could trigger the memory leak, affecting system stability.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: NO
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

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

linux

Temporarily disable AppArmor to prevent exploitation of this vulnerability

sudo systemctl stop apparmor
sudo systemctl disable apparmor

Restrict AppArmor policy operations

linux

Limit 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

📤 Share & Export