← Lab /Security & privacy

Copy Fail and DirtyFrag provide reliable root escalation via Linux page-cache corruption

The page-cache bugs Copy Fail and DirtyFrag give attackers practical, reliable privilege-escalation paths on vulnerable Linux kernels.

Security & privacy Elastic Security Labs 9 May 2026 Disclosure Prototype evidence

Published as “Copy Fail and DirtyFrag: Linux Page Cache Bugs in the Wild”

Why it matters

Defenders can detect and mitigate these page-cache privilege-escalation attacks before patches are applied, reducing the window of exposure.

Summary

The writeup describes two Linux kernel bugs-Copy Fail (CVE-2026-31431) and DirtyFrag-that corrupt the page cache to overwrite in-memory SUID binaries and gain root. Both exploits use legitimate kernel interfaces (AF_ALG/AF_RXRPC sockets and splice) and have public proof-of-concept code, with Copy Fail already seen in the wild. Elastic Security Labs proposes detection rules based on auditd syscall patterns and process-execution heuristics, and offers mitigation steps such as module blocking and namespace restrictions. The evidence consists of public exploit scripts, inclusion in CISA's KEV catalog, and example detection queries, but no large-scale evaluation is presented.

What they found 4

  1. Copy Fail has been observed in real-world attacks and is listed in CISA's KEV catalog.

    “Copy Fail has been reported as exploited in the wild and was added to CISA's Known Exploited Vulnerabilities catalog.”

  2. DirtyFrag remains exploitable on systems that only mitigated Copy Fail because it does not rely on the algif_aead module.

    “DirtyFrag does not depend on the algif_aead module, meaning systems that only applied the Copy Fail mitigation may still be exposed.”

  3. Both exploits use the same primitive: AF_ALG/AF_RXRPC sockets combined with splice to corrupt the page cache.

    “Both Copy Fail and DirtyFrag rely on socket(AF_ALG) to access the kernel crypto subsystem, and splice() to inject read-only file pages into network buffers where in-place cryptographic operations corrupt the page cache.”

  4. Detection can be performed by monitoring non-root processes that create AF_ALG or AF_RXRPC sockets and issue splice calls.

    “The following query aggregates these syscalls by process and surfaces any non-root process combining AF_ALG or AF_RXRPC sockets with splice calls at volume :”

Caveats 5

  • Detection may be limited where auditd syscall auditing is not enabled, prompting a fallback to generic process-exec monitoring.
  • Module blacklisting can disrupt legitimate services such as IPsec VPNs or container runtimes.
  • We also assessed detection options using process exec events only, as those tend to be enabled in more environments than auditd syscall auditing.
  • These mitigations should be tested in a staging environment before production deployment, as disabling kernel modules may impact IPsec VPNs, crypto applications, or other services depending on the affected subsystems.
  • Restricting unprivileged user namespace creation also hardens against DirtyFrag and similar exploits: sysctl -w kernel.unprivileged_userns_clone=0

What’s new here 4

  • Identification of two page-cache corruption bugs (Copy Fail, DirtyFrag) that enable root escalation.
  • Detection logic that correlates AF_ALG/AF_RXRPC socket creation with splice syscalls via auditd and EQL.
  • Mitigation guidance including kernel module blacklisting and unprivileged namespace restrictions.
  • Public exploit evidence and inclusion of Copy Fail in CISA's Known Exploited Vulnerabilities catalog.