yum update kernel or apt upgrade linux-image, saw the transaction complete, and moved on. Weeks later someone asks: is CVE-2022-0847 (Dirty Pipe) actually fixed on that box? You check uname -r and see a version number that looks recent. But that alone proves nothing. The installed package might be patched while the running kernel is still the old one (no reboot happened), or the running kernel might be a custom build that never included the fix. Here is how to verify the patch is active on the system that is running right now.
What Dirty Pipe actually broke
splice syscall moved data from a file into a pipe, the kernel failed to clear the PIPE_BUF_FLAG_CAN_MERGE flag on newly allocated pipe buffers. An unprivileged user could exploit this to overwrite the contents of read-only files cached in the page cache, including things like /usr/bin/su or /etc/passwd, and escalate to root.
The fix is small: the kernel now zeros out the flags field when allocating pipe buffers, so PIPE_BUF_FLAG_CAN_MERGE is never set on a fresh buffer that came from a splice. Every major distribution shipped patched kernels shortly after disclosure. The question is whether your running system is actually using one of those patched kernels.
Step 1: Compare running kernel to installed kernel
BASH
uname -rBASH
rpm -qa | grep kernel | sortBASH
dpkg -l | grep linux-imageuname -r reports, the system was upgraded but never rebooted. The old, potentially vulnerable kernel is still running. No amount of package-level verification matters until you reboot into the patched kernel.
This is the single most common reason a kernel patch "doesn't work." Support engineers see it regularly: the admin ran the update, confirmed the package is installed, but skipped the reboot. On a shared hosting node or a production VPS host, scheduling that reboot is inconvenient, so it gets postponed indefinitely.
For a deeper look at why uname -r alone is insufficient for confirming kernel LPE patches, there is a related walkthrough here: Thinking uname -r Proves You're Patched Against a Kernel LPE? Check the Changelog.
Step 2: Check the changelog for CVE-2022-0847
5.4.x might or might not include the fix depending on the distro's patch set.
On RHEL-family systems:
BASH
rpm -q --changelog kernel-$(uname -r) | grep -i 'CVE-2022-0847'BASH
zgrep -i 'CVE-2022-0847' /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gzuname -r output ends with -dirty or a + suffix, that typically means the kernel was compiled from a source tree with uncommitted modifications. It has nothing to do with the Dirty Pipe vulnerability itself. It is a build-system flag indicating the source was modified from the tagged release.
Step 3: Verify splice behavior without running an exploit
- Vulnerable: after
splice(), the pipe buffer retainsPIPE_BUF_FLAG_CAN_MERGE, so a subsequentwrite()to the pipe overwrites the page cache. - Patched: the flag is cleared, so a
write()to the pipe allocates a new buffer instead of merging into the cached page.
check_dirtypipe.c):
C
// Safe CVE-2022-0847 verification - read-only check against a temp file
// Compile: gcc -o check_dirtypipe check_dirtypipe.c
// Run as unprivileged user, NOT as root
#define _GNU_SOURCE
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int main() {
// Create a temp file with known content
char template[] = "/tmp/dptest_XXXXXX";
int fd = mkstemp(template);
if (fd < 0) { perror("mkstemp"); return 1; }
// Write more than one page so splice has something to work with
char original[] = "AAAAAAAAAAAAAAAA";
write(fd, original, sizeof(original) - 1);
lseek(fd, 0, SEEK_SET);
// Set up a pipe
int pipefd[2];
if (pipe(pipefd) < 0) { perror("pipe"); return 1; }
// Fill and drain the pipe to cycle through buffers
// (the vulnerability requires reused pipe buffers)
unsigned pipe_size = fcntl(pipefd[1], F_GETPIPE_SZ);
char *buf = malloc(pipe_size);
memset(buf, 'B', pipe_size);
write(pipefd[1], buf, pipe_size);
read(pipefd[0], buf, pipe_size);
// Splice one byte from the file into the pipe
loff_t offset = 1; // skip first byte
ssize_t spliced = splice(fd, &offset, pipefd[1], NULL, 1, 0);
if (spliced < 0) { perror("splice"); return 1; }
// Attempt to write into the pipe (this is where the bug triggers)
char overwrite[] = "HACKED";
write(pipefd[1], overwrite, sizeof(overwrite) - 1);
// Now read the original file and check if it was modified
lseek(fd, 0, SEEK_SET);
char readback[64] = {0};
read(fd, readback, sizeof(readback) - 1);
close(fd);
close(pipefd[0]);
close(pipefd[1]);
if (strstr(readback, "HACKED")) {
printf("VULNERABLE: file content was modified via pipe write.\
");
printf("File content: %s\
", readback);
} else {
printf("PATCHED: file content unchanged. CVE-2022-0847 fix is active.\
");
printf("File content: %s\
", readback);
}
unlink(template);
free(buf);
return 0;
}BASH
gcc -o check_dirtypipe check_dirtypipe.c && ./check_dirtypipeTEXT
# Illustrative output format
PATCHED: file content unchanged. CVE-2022-0847 fix is active.
File content: AAAAAAAAAAAAAAAArm check_dirtypipe check_dirtypipe.c.
Important: run this as an unprivileged user. Running as root proves nothing because root can overwrite files anyway.
When the changelog is clean but the kernel is still old
- Multiple kernels installed, wrong one in GRUB default. Check
grubby --default-kernel(RHEL-family) orgrep GRUB_DEFAULT /etc/default/grub(Debian-family) to see which kernel boots by default. - Virtualization layer caching. On some VPS platforms, the hypervisor supplies the kernel, and updating packages inside the guest does nothing. Check whether your provider uses a host-managed kernel (common with older OpenVZ or some Proxmox LXC configurations). If so, the provider must update the host kernel.
- Custom-compiled kernels. If someone built the kernel from source, package manager changelogs will not exist. You need to check the source commit history or rely on the splice test above.
Broader context: kernel LPE is a pattern, not a one-time event
- Confirm the running kernel matches the installed, patched package.
- Search the changelog for the specific CVE ID.
- If possible, test the specific subsystem behavior safely.
- Reboot if the running kernel is older than the installed one.
The short version
uname -r matches the latest installed kernel package, meaning a reboot happened after the update. (2) The changelog for that package references CVE-2022-0847. (3) The splice test against a temp file confirms the pipe buffer flag fix is active. If any of these fail, the system is not protected, regardless of what the package manager says. Reboot into the patched kernel, re-run the checks, and move on.