Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is Dirty Pipe?

Dirty Pipe, CVE-2022-0847, let any Linux user overwrite data in read-only files through an uninitialised pipe buffer flag. It was simpler and more reliable than Dirty COW.

Illustration for the cybersecurity term Dirty Pipe
Home / Blog / Cybersecurity Terms / What Is Dirty Pipe?
17 November 2026

What Is Dirty Pipe?

What Is Dirty Pipe?

Dirty Pipe is CVE-2022-0847, a Linux kernel vulnerability disclosed on 7 March 2022 by Max Kellermann of CM4all. It allows an unprivileged local user to overwrite data in files they can only read, which is enough to take root on most systems. The name deliberately echoes Dirty COW, and the outcome is similar, but the mechanism is cleaner and the exploit is far easier to write.

How It Was Found

Kellermann’s account of the discovery is one of the better pieces of public vulnerability writing. His company’s web hosting platform kept producing corrupted log files: compressed archives whose final bytes were wrong, in a pattern that looked random but recurred. Over several months he traced it from a support ticket, through gzip headers, to a splice operation in the kernel. The bug was not found by fuzzing or by auditing; it was found by refusing to dismiss intermittent data corruption as a hardware fault.

The Flaw

Linux pipes are implemented as a ring of pipe_buffer structures, each pointing at a page of memory and carrying a set of flags. One of those flags, PIPE_BUF_FLAG_CAN_MERGE, indicates that a subsequent write may be merged into the existing page rather than allocating a new one. It was introduced in kernel 5.8, released in August 2020, as part of a performance refactor.

The refactor missed one initialisation. When a page was added to a pipe by splice() — which maps a page of the page cache into the pipe without copying it — the flags field retained whatever value it held from a previous use of that buffer structure. An attacker could arrange for PIPE_BUF_FLAG_CAN_MERGE to be set, then splice a page of a read-only file into the pipe, then write to the pipe. The kernel merged the write into the spliced page, which was the page cache entry for the file. The file’s contents changed in memory for every process on the system.

The constraints are modest: the attacker needs read permission on the file, cannot modify the first byte of a page, cannot extend the file, and the change does not persist to disk. None of that matters when the target is a setuid binary or /etc/passwd, and working exploits appeared within a day.

Affected Versions

Kernels from 5.8 onward are affected. Fixes landed in 5.16.11, 5.15.25, and 5.10.102, released at the end of February 2022, and distributions backported them promptly. Android devices on kernel 5.8 or later were also vulnerable, including the Pixel 6 and Galaxy S22, and Google shipped a fix in the May 2022 Android security bulletin.

Systems on long-term support kernels older than 5.8 — including many enterprise distributions at the time — were never vulnerable, which is a rare case of conservative kernel versions paying off.

Why It Matters Operationally

Dirty Pipe is a textbook demonstration that a performance optimisation in memory management can become a universal local root. Three practical consequences follow.

Detection and Hardening

Exploitation leaves little evidence, because the modification happens in the page cache rather than on disk and disappears on reboot. Practical monitoring focuses on the consequences: unexpected root shells, new setuid files, modifications to /etc/passwd or /etc/shadow detected by file integrity monitoring, and audit records of unusual splice() usage by processes that have no business performing it.

For hardening, keep kernels current and confirm the running version rather than the installed package, restrict interactive access to servers, apply seccomp and mandatory access control profiles, and separate tenants at a stronger boundary than namespaces where the workload justifies it.

Reviewing whether a local escalation would actually be reachable in your environment is part of our infrastructure security testing services.

FAQ – Frequently Asked Questions

Which Kernel Versions Are Vulnerable to Dirty Pipe?

Linux kernels from 5.8, released in August 2020, up to the fixes in 5.16.11, 5.15.25, and 5.10.102, published at the end of February 2022. Earlier long-term support kernels were never affected, because the flag involved did not exist before the 5.8 refactor. Verify the running kernel version rather than the installed package version.

How Is Dirty Pipe Different From Dirty COW?

Both let an unprivileged user write to read-only files, but Dirty COW exploited a race condition in copy-on-write handling and required precise timing, while Dirty Pipe exploited an uninitialised flag and is deterministic. That makes Dirty Pipe simpler, faster, and more reliable to exploit, with no risk of destabilising the system through repeated race attempts.

Does the Change Persist After a Reboot?

No. The modification affects the page cache in memory, not the file on disk, so the original contents return after a reboot or once the cache entry is evicted. This does not reduce the impact, because an attacker only needs the altered content to exist long enough to run a modified setuid binary or authenticate as root.

Were Android Devices Affected?

Yes, any device shipping a kernel of 5.8 or later, which included the Pixel 6 and Galaxy S22 among others. Google addressed it in the May 2022 Android security bulletin. Older devices on earlier kernels were unaffected. As with Dirty COW, the practical problem was the number of handsets that receive updates slowly or not at all.

Related Terms

You May Be Interested In These

What Is Promotion Abuse?

Cybersecurity Terms

17 November 2026

What Is Promotion Abuse?

Read More
What Is Secure Device Commissioning?

Cybersecurity Terms

17 November 2026

What Is Secure Device Commissioning?

Read More
How Do You Detect Timestamp Manipulation?

Cybersecurity Terms

17 November 2026

How Do You Detect Timestamp Manipulation?

Read More