⚠️

سلب مسئولیت و اخلاق حرفه‌ای

این مطالب صرفاً برای اهداف آموزشی، پژوهشی و افزایش آگاهی امنیتی ارائه شده‌اند. هرگونه استفاده غیرمجاز، غیرقانونی یا سوءاستفاده از اطلاعات، ابزارها و روش‌های مطرح‌شده، کاملاً بر عهده مخاطب است. نویسنده و منتشرکننده هیچ مسئولیتی در قبال خسارات، آسیب‌ها یا پیامدهای ناشی از استفاده نادرست از این مطالب نخواهند داشت.

CVE-2026-139678: Linux Kernfs Notification Lock Contention Can Disrupt Multi-Tenant Systems | Alireza Bolbolabadi - Red Team Security
LOADING

CVE-2026-139678: Linux Kernfs Notification Lock Contention Can Disrupt Multi-Tenant Systems

Executive summary

CVE-2026-139678 addresses a Linux kernel locking flaw in the kernfs notification path. Under sustained memory pressure, a workload that watches cgroup memory-event files with inotify can keep the kernel notification worker inside memory allocation and reclaim while it holds read locks. Because a waiting writer prevents subsequent readers from acquiring the lock, unrelated processes accessing cgroup-related interfaces may stall for extended periods.

Meta reported observing the condition in production on multi-tenant systems, where pressure in one workload disrupted unrelated workloads and daemons including below and fb-oomd. The available record does not identify affected kernel releases, fixed releases, CVSS data, public exploit code, or active exploitation. The practical impact is primarily availability-related, making the vulnerability most relevant to shared hosting and other environments where tenants can control cgroup activity and inotify watches.

Technical overview

The affected functionality delivers filesystem notifications for kernfs-backed interfaces, including cgroup v2 memory-event files such as memory.events.

The problematic implementation of kernfs_notify_workfn() held both kernfs_supers_rwsem and kernfs_rwsem while calling fsnotify(). Notification-event allocation uses:

kmalloc(GFP_KERNEL_ACCOUNT|__GFP_RETRY_MAYFAIL)

That allocation is charged to the watched cgroup. When the watched cgroup is already under extreme memory pressure, the worker can enter memory reclaim and continue generating limit-hitting notifications. The worker therefore spends an extended period blocked in allocation while retaining its read locks.

Although the locks are acquired for reading, a queued writer blocks subsequent readers. Processes that need these locks, including system services and workloads accessing cgroup-related interfaces, can consequently remain stuck behind the notification worker.

Affected systems

The confirmed affected product is the Linux kernel. The supplied advisory does not specify:

  • Exact vulnerable kernel version ranges

  • The first fixed or patched release

  • A CVSS score or vector

  • The complete upstream fix commit associated with CVE-2026-139678

Risk is greatest on multi-tenant Linux systems where a tenant can generate sustained cgroup memory-limit events and register inotify watches on relevant files. Access requirements vary with the deployment's cgroup, namespace, and security controls. In tightly isolated workloads, the vulnerability may have little practical effect; in shared systems, one workload can impair the availability of unrelated tenants and system daemons.

Root cause

The root cause is an overly broad lock scope in the notification path. Holding kernfs_rwsem across fsnotify() prevents the notification worker from proceeding when memory reclaim takes a long time. The behavior is aggravated by an allocation charged to a cgroup already experiencing the pressure that produced the notification.

The referenced historical commit 400188ae361a, titled kernfs: Acquire kernfs_rwsem in kernfs_notify_workfn()., introduced the lock to support safe reads of kernfs_node::name. The supplied advisory does not present that historical commit as the complete fix for CVE-2026-139678.

Exploitation and real-world impact

The observed trigger is a workload that registers inotify watches on memory.events and repeatedly receives notifications as cgroup limits are reached. This sequence can induce a denial-of-service condition without requiring memory corruption, privilege escalation, or code execution.

The impact centers on system availability:

  • Unrelated workloads may experience elevated latency or stalls.

  • System daemons such as below and fb-oomd may become unresponsive.

  • Cgroup-management processes may be delayed.

  • Queued mount or unmount operations may be held up by the remaining kernfs_supers_rwsem read lock.

The lack of confidentiality or integrity impact, combined with the local-access requirement, keeps the assessed severity at low. However, the production observation demonstrates that the condition can have meaningful operational consequences in dense multi-tenant infrastructure.

Mitigation

The upstream direction is to stop holding kernfs_rwsem across notification delivery. The advisory describes sampling kernfs_node::name once before the notification loop and releasing the lock before invoking fsnotify(). kernfs_supers_rwsem continues to protect the relevant list.

This change introduces two documented behavioral differences:

  • An event for a name longer than NAME_MAX may arrive without a name rather than with the full name. fsnotify() supports an optional name, so the event is still delivered.

  • The name and parent are sampled separately rather than under one lock. The advisory states that current code prevents the resulting mismatch: kernfs_notify() rejects objects that are not files, and no caller of kernfs_rename_ns() renames a file.

Operators should obtain the corresponding fix through the relevant Linux distribution, cloud platform, or hardware vendor's kernel update channel. Because the provided source does not identify precise vulnerable or fixed kernel versions, package metadata and vendor advisories should determine whether a deployed kernel contains the correction.

Where kernel updates cannot be deployed immediately, exposure can be reduced by restricting tenant access to sensitive cgroup memory-event files and controlling inotify access through the host's namespace and security policies. Workloads that experience sustained cgroup-limit events should also be monitored for repeated memory.events notifications and tasks blocked on kernfs_rwsem.

Detection

Useful indicators include:

  • Rising cgroup v2 memory.events limit counters

  • Bursts of inotify events involving memory.events

  • Tasks blocked in kernfs notification, memory reclaim, or related wait queues

  • Increased latency in cgroup access and management operations

  • Stalls affecting below, fb-oomd, mount, or unmount workflows

The supplied advisory does not prescribe exact kernel stack names or tracing events, so detection rules should be validated against the specific deployed kernel version.

Expert insight

This vulnerability illustrates how a resource-control mechanism can become an amplifier of contention. The watched cgroup is charged for event allocation, yet the same allocation path can block while the notification worker holds synchronization locks needed by the rest of the kernel. In a multi-tenant environment, the result is cross-tenant availability degradation without a conventional memory-safety flaw.

The fix narrows lock duration, which is the correct design response to allocation and reclaim in a callback path. It does not eliminate every possible delay: a worker stalled while holding kernfs_supers_rwsem can still impede a queued mount or unmount. That residual limitation makes careful capacity planning and tenant isolation valuable even after patching.

منابع

·
← اخبار