Skip to main content
Vulnerability Database/CVE-2026-98543

CVE-2026-98543: Linux Kernel BPF LSM Privilege Escalation

CVE-2026-98543 is a privilege escalation vulnerability in the Linux kernel's BPF LSM that affects inode locking in path operations. This article covers the technical details, affected versions, security impact, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-98543 Overview

CVE-2026-98543 is a Linux kernel vulnerability in the BPF Linux Security Module (LSM) subsystem. The verifier incorrectly assumes that the inode's i_rwsem is held when sleepable BPF LSM programs attach to the path_unlink and path_rmdir hooks. These hooks execute before vfs_unlink() and vfs_rmdir() acquire the victim inode's i_rwsem, so rewritten bpf_[set|remove]_dentry_xattr() calls mutate extended attributes without the required lock. Upstream maintainers resolved the flaw by dropping the two path hooks from d_inode_locked_hooks, forcing the verifier to retain the locking variants that take the lock themselves.

Critical Impact

A sleepable BPF LSM program attached to path_unlink or path_rmdir can mutate inode xattrs without holding i_rwsem, enabling race conditions and potential filesystem state corruption.

Affected Products

  • Linux kernel (upstream mainline) with BPF LSM path_unlink/path_rmdir hook support
  • Stable kernel branches receiving commits 35d442e, 640d37f, and 7504b67
  • Distributions shipping BPF LSM-enabled kernels (vendor advisories pending)

Discovery Timeline

  • 2026-10-18 - CVE-2026-98543 published to NVD
  • 2026-10-19 - Last updated in NVD database

Technical Details for CVE-2026-98543

Vulnerability Analysis

The BPF verifier uses bpf_lsm_has_d_inode_locked() to decide whether to rewrite calls to bpf_set_dentry_xattr() and bpf_remove_dentry_xattr() into their _locked variants. The _locked variants skip taking the inode's i_rwsem because they assume the caller already holds it. This optimization is safe for most LSM hooks that fire after the VFS has acquired the lock.

The path_unlink and path_rmdir hooks break that assumption. security_path_unlink() and security_path_rmdir() are invoked from the pathwalk layer before vfs_unlink() or vfs_rmdir() acquires the victim inode's i_rwsem. A sleepable BPF LSM program attached to either hook therefore executes the lockless xattr helpers against an unlocked inode, producing a classification consistent with a race condition on kernel data structures ([CWE-362] class behavior).

Root Cause

The root cause is an incorrect entry for path_unlink and path_rmdir in the d_inode_locked_hooks list used by bpf_lsm_has_d_inode_locked(). The list conflates path-level LSM hooks with inode-level hooks whose callers hold i_rwsem. Only inode-level hooks satisfy the locking precondition required by the _locked xattr helpers.

Attack Vector

Exploitation requires the ability to load a sleepable BPF LSM program, which normally requires CAP_SYS_ADMIN or equivalent BPF capabilities on the target host. An attacker with that privilege can attach a program to path_unlink or path_rmdir and trigger concurrent unlink/rmdir operations to race xattr mutation against other filesystem activity. Impact is limited to local scenarios where untrusted or buggy BPF LSM programs are loaded. See the kernel commits 35d442e, 640d37f, and 7504b67 for the authoritative fix.

// No verified public exploit code is available for CVE-2026-98543.
// The vulnerability class and fix are described in the referenced kernel commits.

Detection Methods for CVE-2026-98543

Indicators of Compromise

  • Unexpected loading of sleepable BPF LSM programs attaching to path_unlink or path_rmdir hooks on production systems.
  • Kernel warnings or lockdep splats related to i_rwsem while BPF LSM xattr helpers are in use.
  • Anomalous xattr changes on files immediately preceding unlink or rmdir operations.

Detection Strategies

  • Audit bpftool prog show output for programs of type lsm attached to path_unlink or path_rmdir and review their provenance.
  • Enable kernel audit rules on bpf() syscalls to capture program loads and attachments, correlating with the issuing UID and process.
  • Review kernel versions against the fix commits 35d442e, 640d37f, and 7504b67 to confirm patch status.

Monitoring Recommendations

  • Alert on any BPF LSM program load originating outside sanctioned management tooling or configuration-as-code pipelines.
  • Monitor for repeated unlink/rmdir operations on sensitive paths coinciding with xattr modifications.
  • Track /sys/kernel/debug/tracing and audit logs for BPF-related events on hosts that run multi-tenant workloads.

How to Mitigate CVE-2026-98543

Immediate Actions Required

  • Apply the upstream kernel patches that drop path_unlink and path_rmdir from d_inode_locked_hooks as soon as vendor builds are available.
  • Restrict CAP_BPF and CAP_SYS_ADMIN to trusted administrators and automation accounts only.
  • Inventory sleepable BPF LSM programs in production and remove any that attach to the affected path hooks until the kernel is patched.

Patch Information

The fix is distributed across three stable commits: 35d442e, 640d37f, and 7504b67. Each removes the two path hooks from the locked-hook list so the verifier keeps the locking variants of bpf_set_dentry_xattr() and bpf_remove_dentry_xattr(). Track your distribution's security tracker for backported builds matching your kernel line.

Workarounds

  • Disable or do not load BPF LSM programs that attach to path_unlink or path_rmdir until the kernel is patched.
  • Set kernel.unprivileged_bpf_disabled=1 to reduce the pool of accounts able to load BPF programs.
  • Where feasible, build kernels without CONFIG_BPF_LSM on hosts that do not require BPF-based LSM functionality.
bash
# Reduce exposure by disabling unprivileged BPF and inventorying LSM programs
sysctl -w kernel.unprivileged_bpf_disabled=1
bpftool prog show | grep -E 'lsm|path_unlink|path_rmdir'
auditctl -a always,exit -F arch=b64 -S bpf -k bpf_syscall

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.