Skip to content
RCE Write-up Advanced

Copy Fail The Linux Kernel Flaw That Gives Anyone Root

A logic flaw in the Linux kernel's cryptographic subsystem allows a local unprivileged user to write four bytes into the page cache of any readable file. By targeting a setuid-root binary, an attacker can gain full root access.

Root Follow

Published on systemweakness.com

This one is different from the PackageKit flaw we covered last week. That was a daemon you could disable.

Root & Secure, on systemweakness.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a performance optimisation in kernel 4.14 that allowed in-place buffer reuse in the crypto pipeline, causing a logic flaw when combined with AF_ALG and splice().

Impact

A local unprivileged user could gain full root access, leading to full infrastructure compromise or lateral movement in high-risk environments.

What the attacker needed

Local unprivileged access; kernel 4.14 or later; vulnerable module loaded

The fix

The kernel maintainers fixed it by reverting the optimisation entirely, restoring separate buffer handling.

How it was found

  1. Check the kernel version with uname -r.
  2. Check if the vulnerable module algif_aead is loaded with lsmod.
  3. Apply temporary mitigation by blocking the module and removing it.
  4. Verify the mitigation took effect.
  5. Patch the kernel using the package manager and reboot.
  6. Confirm the patched kernel is running after reboot.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

The Linux kernel is the core of the operating system. A bug in its crypto code lets a normal user write a few bytes into a file's cached copy in memory. If that file is a program that runs with root privileges, the attacker can change what it does and become root.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Root

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.