{
  "slug": "fanotify",
  "term": "fanotify",
  "aliases": [
    "Linux fanotify",
    "fanotify notification group"
  ],
  "definition": "fanotify is a Linux filesystem-event interface that supports object, mount and filesystem monitoring and, with suitable privileges and configuration, access-permission decisions.",
  "note": "Coverage: FAN_EVENT_ON_CHILD reaches immediate children, not a recursive subtree. FAN_MARK_MOUNT watches one mount; FAN_MARK_FILESYSTEM covers one filesystem instance through its different mounts. Mount marks reject handle-based event types such as FAN_CREATE. Both broad mark types require CAP_SYS_ADMIN. [fanotify-mark]\n\nPermissions: FAN_CLASS_NOTIF cannot request permission events. FAN_REPORT_FID cannot be combined with FAN_CLASS_CONTENT or FAN_CLASS_PRE_CONTENT, even for privileged listeners. Content classes can support access decisions, while unprivileged groups must use file handles, can mark only inodes and cannot request permission events. Kernel configuration and filesystem support also constrain the available interface. [fanotify-init]\n\nMapped stores do not provide FAN_MODIFY notifications. FAN_PRE_ACCESS, available since Linux 6.14, can run before mmap; this pre-content permission mechanism does not record later mapped writes. [mmap-hook] [fanotify-mark] Remote network-filesystem events are not reported; queue overflow loses events. When all descriptors referring to the notification group are closed, outstanding permission requests are allowed. Permission interception is therefore not, by itself, a persistent fail-closed policy or a complete change journal. [fanotify-api]\n\nBackup use: broader observation can simplify discovery, but a backup still needs a defined capture and reconciliation protocol. The linked inotify study measures inotify and directory scans; its counts are not fanotify measurements.",
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-17",
  "advantages": [
    "Mount and filesystem marks can avoid installing a separate mark on each directory."
  ],
  "limitations": [
    "Event coverage, permission handling and supported flags depend on mark type, privileges, kernel and filesystem."
  ],
  "related": [
    "inotify",
    "directory-enumeration",
    "incremental-backup"
  ],
  "citations": [
    {
      "id": "fanotify-api",
      "title": "Linux man-pages 6.19: fanotify(7), events, limitations and group closure",
      "url": "https://man7.org/linux/man-pages/man7/fanotify.7.html",
      "accessed": "2026-11-17"
    },
    {
      "id": "fanotify-mark",
      "title": "Linux man-pages 6.19: fanotify_mark(2), mount, filesystem and child marks",
      "url": "https://man7.org/linux/man-pages/man2/fanotify_mark.2.html",
      "accessed": "2026-11-17"
    },
    {
      "id": "fanotify-init",
      "title": "Linux man-pages 6.19: fanotify_init(2), notification classes and unprivileged groups",
      "url": "https://man7.org/linux/man-pages/man2/fanotify_init.2.html",
      "accessed": "2026-11-17"
    },
    {
      "id": "mmap-hook",
      "title": "Linux v6.14: fsnotify_mmap_perm pre-content hook",
      "url": "https://raw.githubusercontent.com/torvalds/linux/v6.14/include/linux/fsnotify.h",
      "accessed": "2026-11-17"
    },
    {
      "id": "hesela-inotify",
      "title": "Hesela: What inotify misses: mapped writes and collapsed change events",
      "url": "https://hesela.com/analyses/inotify-change-detection/",
      "accessed": "2026-11-17"
    }
  ],
  "provenance": [
    "Linux man-pages 6.19 plus the Linux v6.14 mmap hook; distinguishes pre-content permission from mapped-write notification. No native fanotify or backup-product experiment."
  ]
}
