What FIM actually monitors
/usr/sbin/sshd with a backdoored binary, injecting a malicious line into /etc/passwd, or dropping a webshell into a document root — that question is exactly right. The attacker modifies a file, FIM catches it.
Page-cache exploits ask a different question entirely.
How page-cache exploits bypass disk entirely
/etc/passwd, the kernel checks whether those pages are already cached in RAM. If they are, the disk is never touched.
Exploits in this category — Dirty Pipe (CVE-2022-0847) was the well-known predecessor, and Copy Fail (CVE-2026-31431) targets a similar surface — abuse flaws in how the kernel handles page-cache entries. The attack flow, simplified:
- Attacker opens a file they can read (say, a SUID binary or a sensitive config file).
- Through a kernel bug (in Copy Fail's case, related to memory management page-cache handling), the attacker overwrites the cached pages of that file in memory.
- Any process that subsequently reads that file gets the attacker's modified version — from the page cache.
- The on-disk file remains untouched.
Why polling frequency does not fix this
IN_MODIFY event fires. No fanotify notification. The filesystem layer genuinely does not know anything changed.
What to monitor instead: process behavior
- Unexpected privilege transitions. A process running as an unprivileged user suddenly spawns a child process running as root. Or
/usr/bin/sugets invoked by a process that has no business calling it. - Unusual parent-child process trees. A web server worker spawning
/bin/bashas root. A PHP process forking a process that writes to/etc/shadow. - Suspicious syscall patterns. Heavy use of
splice(),sendfile(), or specificioctl()calls against file descriptors in patterns that match known exploit chains. - New network listeners or outbound connections from processes that should not have them.
auditd) can catch several of these. For example, to log every time a process changes its effective user ID to root (UID 0):
BASH
# Log execve calls where the effective UID becomes 0 (root)
auditctl -a always,exit -F arch=b64 -S execve -F euid=0 -F auid!=0 -k priv_escalationexecve (program execution) syscall on 64-bit systems where the effective UID is 0 but the audit UID (the original login UID) is not 0. That catches the moment an unprivileged user's process starts executing something as root — exactly what a successful LPE produces.
To make this persistent across reboots, add it to /etc/audit/rules.d/ (the exact file and path depend on your distribution and auditd version).
For broader runtime detection, tools like Falco (an open-source runtime security project) watch syscalls in real time and match them against rules. A rule detecting unexpected shell spawns from system binaries might look like:
YAML
# Illustrative Falco rule - syntax may vary by version
- rule: Unexpected shell from system binary
desc: Detect shell spawned by a system binary that should not spawn shells
condition: spawned_process and shell_procs and proc.pname in (sshd, httpd, nginx, php-fpm)
output: "Shell spawned by system binary (user=%user.name parent=%proc.pname command=%proc.cmdline)"
priority: WARNINGspawned_process and shell_procs need to be defined or come from default rulesets. The point is that detection moves from "did a file change on disk" to "is a process doing something it should not."
Patching is still the primary defense
uname -r alone is not sufficient — the version string does not always tell you which specific CVE patches are included. For a deeper look at why, and how to check the changelog instead, see Thinking uname -r Proves You're Patched Against a Kernel LPE? Check the Changelog.
If you need to understand how Copy Fail's mechanics compare to earlier page-cache exploits like Dirty COW or Dirty Pipe, and whether that difference affects your patch urgency, Dirty COW vs Copy Fail: Which Kernel LPE Mechanics Matter for Your Patch Decision? covers that comparison.
Layering detection correctly
- FIM for disk-based changes to critical files (
/etc/passwd,/etc/shadow,/usr/sbin/sshd, web document roots, cron directories). - auditd rules for privilege escalation events — the
execverule above is a starting point. Also consider watching writes to sensitive files like/etc/ld.so.preload(a common persistence mechanism after kernel exploits). - Process-tree monitoring through Falco, Sysdig, or similar runtime tools, watching for anomalous parent-child relationships.
- Kernel patching as the actual fix, with changelog verification rather than version-string assumptions.
