All ArticlesSecurity2026-11-14T02:30:26+08:00

Dirty COW vs Copy Fail: Which Kernel LPE Mechanics Matter for Your Patch Decision?

You face a new kernel privilege escalation CVE and need to decide whether an emergency reboot-and-patch is warranted or a mitigation buys time. After reading, you will understand the exploit mechanics behind page-cache corruption LPEs and how to compare severity factors to prioritize your response.

A new kernel privilege escalation CVE drops. Your distro's security mailing list says "local privilege escalation, high severity, update immediately." You manage dozens of servers, each running production workloads. Rebooting means downtime. Not rebooting means risk. The question is never "should I patch?" — it is always "how fast, and can I buy time with a mitigation first?" Answering that requires understanding what the exploit actually does at a mechanical level, not just reading a CVSS score.

This teardown compares two page-cache corruption LPEs — Dirty COW (CVE-2016-5195) and Copy Fail (CVE-2026-31431) — to show how exploit mechanics should drive your patch urgency, not just severity labels.

Initial impact: same outcome, different blast radius

Both vulnerabilities let an unprivileged local user write to files they should only be able to read, ultimately achieving root. Both corrupt the kernel's page cache — the in-memory layer where the kernel stores copies of file contents so it does not have to read from disk every time. If an attacker can write controlled bytes into the page cache of a sensitive file (say, /etc/passwd or a setuid binary), they own the box.

But "local privilege escalation to root" describes the destination, not the road. The road matters because it determines how reliably the exploit works, whether it leaves traces, and whether you can block it without a kernel update.

The race condition road: Dirty COW

Dirty COW (CVE-2016-5195, disclosed October 2016) exploits a race condition in the kernel's Copy-on-Write (CoW) mechanism for memory-mapped files. When a process maps a read-only file into memory and then writes to it, the kernel is supposed to create a private copy of the page — the "copy on write." Dirty COW wins a race between two kernel operations: the page fault handler that creates the private copy and the madvise(MADV_DONTNEED) call that discards it. By rapidly alternating between writing and discarding, an attacker can trick the kernel into writing directly to the original page cache instead of the private copy.

Key mechanical properties:

  • Probabilistic. It is a race condition. The attacker needs to win the race, which typically requires many attempts. On a busy system, timing varies. The exploit might take seconds or minutes, and it can occasionally crash the process or corrupt memory in unintended ways.
  • Broad attack surface. Any readable file can be targeted. No special kernel module needs to be loaded. If the kernel is vulnerable, the exploit works.
  • Noisy under observation. Rapid madvise calls and repeated page faults generate detectable patterns in system call traces and performance counters, though few people were monitoring for this in 2016.
  • Existed for nearly a decade. The bug was introduced around kernel 2.6.22 (2007) and went unpatched until 2016. Every Linux system in that window was vulnerable.

The deterministic logic flaw road: Copy Fail

Copy Fail (CVE-2026-31431, disclosed April 2026 per available advisories) is a different animal. It targets a logic flaw in the kernel's cryptographic subsystem, specifically the AF_ALG socket interface and the authencesn module. Due to a long-standing in-place optimization, the crypto subsystem writes output directly back into the source pages under certain conditions. An unprivileged user can open an AF_ALG socket, feed it pages from a readable file, and force a controlled 4-byte write back into the page cache of that file.

Key mechanical properties:

  • Deterministic. No race condition. No timing sensitivity. The logic flaw fires reliably on every attempt. According to public write-ups, the exploit fits in roughly 732 bytes of code. That reliability is what makes it dangerous.
  • Narrow attack surface. Requires the af_alg and authencesn kernel modules to be loaded (or loadable). Many production web servers never use the kernel crypto API from userspace, which means the module may not be loaded by default — but on many distributions, an unprivileged user can trigger module auto-loading.
  • Quiet. A single AF_ALG socket operation looks like normal crypto usage. No thousands of rapid system calls. No repeated page faults. Harder to spot without specific audit rules.
  • Smaller write primitive. A controlled 4-byte write is enough to modify /etc/passwd or patch a binary, but it is more constrained than Dirty COW's arbitrary-length write window.

Critical discovery: what drives your patch decision

When you compare these two side by side, the factors that matter for your response timeline become clear:

FactorDirty COW (CVE-2016-5195)Copy Fail (CVE-2026-31431)
Exploit reliabilityProbabilistic (race condition)Deterministic (logic flaw)
Required kernel moduleNone (core mm subsystem)af_alg / authencesn
Temporary mitigation possibleNo practical mitigation short of patchingBlacklist or unload the module
Detection difficultyModerate (noisy syscall pattern)High (looks like normal crypto op)
Exploit complexityModerate (needs race-winning loop)Low (short, reliable, scriptable)

This comparison reveals a counterintuitive conclusion: Copy Fail is more reliably exploitable, but Dirty COW is harder to mitigate without a kernel update.

For Dirty COW, there was no module to unload, no firewall rule to add. The bug sat in the core memory management path. Your only real option was to patch and reboot. Emergency maintenance window, full stop.

For Copy Fail, you have a temporary option: prevent the vulnerable module from loading. If authencesn is not loaded and cannot be auto-loaded, the exploit has no entry point.

Temporary mitigation for Copy Fail

If you need to buy time before a reboot, you can blacklist the module. Check if it is currently loaded:

lsmod | grep authencesn

If loaded, unload it (this may fail if something is actively using it):

sudo modprobe -r authencesn

To prevent auto-loading on future boot or by unprivileged user triggers, add a blacklist entry:

echo 'install authencesn /bin/false' | sudo tee /etc/modprobe.d/blacklist-copyfail.conf

This tells the kernel to run /bin/false instead of loading the module, effectively blocking it. This is a stopgap, not a fix. The underlying code is still vulnerable. Patch and reboot as soon as your maintenance window allows.

Note: whether this mitigation is sufficient depends on your distribution and kernel configuration. Some setups may have the crypto code compiled directly into the kernel rather than as a loadable module, in which case blacklisting does nothing. Verify with your distro's advisory.

The architectural fix and what to verify after patching

For both vulnerabilities, the real fix is a kernel update from your distribution's package manager. The mainline fix for Copy Fail reverts the unsafe in-place optimization in the crypto subsystem. The Dirty COW fix added proper serialization to the page fault and CoW breakage path.

After updating and rebooting, do not stop at checking uname -r. A newer kernel version string does not guarantee the specific CVE fix is included — backport patching means the fix might land in a kernel that keeps the same version number. Check the package changelog for the specific CVE ID. For more on why uname -r alone is insufficient, see Thinking uname -r Proves You're Patched Against a Kernel LPE? Check the Changelog.

For Copy Fail specifically, verify the module behavior after patching:

# Confirm patched kernel is running
uname -r
# Check package changelog for CVE reference
# On RHEL/CentOS:
rpm -q --changelog kernel | grep -i 'CVE-2026-31431'
# On Debian/Ubuntu:
apt changelog linux-image-$(uname -r) 2>/dev/null | grep -i 'CVE-2026-31431'

How to think about the next one

Every kernel LPE lands with a CVSS score and an advisory that says "update immediately." That advice is correct but incomplete. When you are managing real infrastructure with real uptime commitments, the mechanical details change your response:

  1. Is the exploit deterministic or probabilistic? Deterministic exploits get weaponized faster. Public proof-of-concept code for Copy Fail appeared quickly because the bug is reliable and simple. Race conditions like Dirty COW still get exploited, but there is a slightly wider window before reliable tooling spreads.

  2. Can you cut the attack surface without patching? If the vulnerability lives in a loadable module your workload does not need, unloading and blacklisting buys real time. If it is in core kernel code (memory management, filesystem layer, scheduler), there is no shortcut.

  3. What does exploitation look like in logs? If the exploit is noisy, you can at least detect attempts while you schedule the patch. If it is quiet, assume any delay is time an attacker could be using.

  4. Does your environment even expose the attack surface? A kernel LPE requires local access. On a shared hosting server where customers have shell access, that is immediate risk. On a dedicated server where only your team has SSH, the exposure is lower (but not zero — a compromised web application gives local access too).

The patch decision is not "should I" but "how fast." Understanding the exploit mechanics turns that from a guess into an informed call. When you cannot reboot immediately, knowing whether a mitigation exists — and whether it actually blocks the specific attack path — is the difference between managed risk and hope.