CVE-2024-35797

5.5 MEDIUM

📋 TL;DR

A Linux kernel memory management vulnerability in cachestat for shmem (shared memory) allows out-of-bounds memory access or incorrect cache statistics when cachestat operations race with swapping/invalidation. This affects Linux systems using shared memory with swapping enabled. The vulnerability requires local access to trigger.

💻 Affected Systems

Products:
  • Linux kernel
Versions: Specific affected versions not explicitly stated in CVE, but patches target stable kernel branches. Likely affects multiple recent kernel versions before fixes.
Operating Systems: Linux distributions using affected kernel versions
Default Config Vulnerable: ⚠️ Yes
Notes: Requires shmem (shared memory) usage and swapping enabled. Systems without swap or shmem usage are not affected.

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

⚠️ Risk & Real-World Impact

🔴

Worst Case

Out-of-bounds memory access could lead to kernel panic (system crash) or potential information disclosure from kernel memory.

🟠

Likely Case

System instability or crash when cachestat races with swapping operations on shmem, or incorrect cache statistics reporting.

🟢

If Mitigated

Minor performance impact from incorrect cache statistics without system compromise.

🌐 Internet-Facing: LOW - Requires local access to trigger, not remotely exploitable.
🏢 Internal Only: MEDIUM - Local users or processes could trigger system instability or crashes affecting shared systems.

🎯 Exploit Status

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

Exploitation requires race conditions between cachestat operations and swapping/invalidation, making reliable exploitation challenging. Requires local access.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Patches available in stable kernel branches via git commits referenced in CVE

Vendor Advisory: https://git.kernel.org/stable/c/24a0e73d544439bb9329fbbafac44299e548a677

Restart Required: Yes

Instructions:

1. Update Linux kernel to patched version from your distribution vendor. 2. Reboot system to load new kernel. 3. Verify kernel version after reboot.

🔧 Temporary Workarounds

Disable swap on shmem systems

linux

Prevent the race condition by disabling swap, though this may impact system performance

swapoff -a
Edit /etc/fstab to comment out swap lines

Limit shmem usage

linux

Reduce shared memory usage to minimize exposure

sysctl -w kernel.shmmax=67108864
sysctl -w kernel.shmall=4194304

🧯 If You Can't Patch

  • Monitor system logs for kernel panics or instability related to memory operations
  • Implement strict access controls to limit local user privileges on affected systems

🔍 How to Verify

Check if Vulnerable:

Check kernel version and compare with patched versions from your distribution. Vulnerable if using unpatched kernel with shmem and swap enabled.

Check Version:

uname -r

Verify Fix Applied:

Verify kernel version matches patched version from vendor and system remains stable during cachestat operations on shmem.

📡 Detection & Monitoring

Log Indicators:

  • Kernel panic logs
  • Out of bounds memory access errors in dmesg
  • System instability/crash during memory operations

Network Indicators:

  • None - local vulnerability only

SIEM Query:

source="kernel" AND ("panic" OR "Oops" OR "BUG") AND ("cachestat" OR "shmem" OR "swap")

🔗 References

📤 Share & Export