[LTP] [PATCH 0/2] Add test for fanotify monitoring of tracefs

Martin Doucha mdoucha@suse.cz
Fri Feb 20 16:47:07 CET 2026


Add test for reading basic fanotify events from a tracefs mount.
The test will activate monitoring of FAN_MODIFY events from the
whole mountpoint, create a new kprobe, activate it, deactivate it
and remove it again. This should generate exactly 4 FAN_MODIFY events.

On some kernels with badly backported tracefs fixes, this may trigger
NULL pointer dereference. The testcase is intentionally simple but
sufficient to trigger this kind of bug. More complex tracing subtests
can be added later.

Martin Doucha (2):
  tst_fs.h: Add TST_TRACEFS_MAGIC constant
  Add test for fanotify monitoring of tracing filesystem

 include/tst_fs.h                              |   1 +
 runtest/syscalls                              |   1 +
 runtest/tracing                               |   1 +
 testcases/kernel/syscalls/fanotify/.gitignore |   1 +
 .../kernel/syscalls/fanotify/fanotify25.c     | 126 ++++++++++++++++++
 5 files changed, 130 insertions(+)
 create mode 100644 testcases/kernel/syscalls/fanotify/fanotify25.c

-- 
2.52.0



More information about the ltp mailing list