{"id":"CVE-2026-99824","aliases":["CVE-2026-99824"],"related":[],"kind":"vulnerability","state":"published","title":"fs: let backing files inherit FMODE_NONOTIFY from the user file","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nfs: let backing files inherit FMODE_NONOTIFY from the user file\n\nWhen fanotify reports a permission event, copy_event_to_user() creates\nthe event fd with dentry_open_nonotify(), so that the listener's use of\nthat fd does not generate further events. If the event's path is on a\nstacked filesystem, the stacked filesystem's ->open() opens the real\nfile with backing_file_open(). Since commit ebe559609d78 (\"fs: get rid\nof __FMODE_NONOTIFY kludge\"), FMODE_NONOTIFY lives in f_mode only and\nthe backing file does not inherit it: it is allocated with the default\nfsnotify mode, and fsnotify_open_perm_and_set_mode() raises FS_OPEN_PERM\non the real path if the backing filesystem has permission event\nwatchers.\n\nBefore that commit __FMODE_NONOTIFY travelled in f_flags, and overlayfs\ncopies the user file's f_flags into the backing open\n(ovl_open_realfile()), so the backing file was exempt implicitly. Commit\nbc2473c90fca (\"ovl: enable fsnotify events on underlying real files\")\nrelied on that when it dropped FMODE_NONOTIFY from OVL_OPEN_FLAGS.\n\nThe nested event is queued to the same group, from inside the\nlistener's read(2), and can only be answered by another reader thread\nof that group. A listener holding filesystem marks on both the stacked\nand the backing filesystem therefore deadlocks as soon as all of its\nreader threads are inside such a read(2) at the same time, and every\nother task that touches a marked filesystem queues up behind it.\n\nObserved with a commercial anti-malware agent (16 reader threads) on an\nostree/composefs host: / is an overlayfs whose data layer is the ostree\nobject store on the same btrfs that holds /etc and /home, and a\nsystemd-sysext overlay sits on /usr. Every on-demand scan of /usr wedged\nthe whole machine until the group was killed. Stack of a blocked reader\nthread on 7.2.7:\n\n  fanotify_get_response\n  fanotify_handle_event\n  send_to_group\n  fsnotify\n  __fsnotify_parent\n  do_dentry_open\n  vfs_open\n  backing_file_open\n  ovl_open_realfile [overlay]\n  ovl_open [overlay]\n  do_dentry_open\n  vfs_open\n  backing_file_open\n  ovl_open_realfile [overlay]\n  ovl_open [overlay]\n  do_dentry_open\n  vfs_open\n  dentry_open_nonotify\n  copy_event_to_user\n  fanotify_read\n  vfs_read\n  ksys_read\n\nUserspace cannot avoid this: the backing open happens while the kernel\nbuilds the fd, before the event is reported, and fid reporting is not\navailable for permission event classes.\n\nMake a backing file inherit FMODE_NONOTIFY when the user file it is\nopened for must not generate events. This restores the pre-6.14\nbehaviour for the fds that fanotify creates (and for any other\nFMODE_NONOTIFY file), while ordinary opens through a stacked filesystem\nkeep generating events on the real path, as intended by bc2473c90fca.\n\nVerified with a self-contained reproducer (private tmpfs lower layers, an\noverlayfs over them, FAN_OPEN_PERM filesystem marks on the overlay and on\none lower layer, a child opening a file through the overlay) in a qemu\nVM on this tree built with defconfig plus OVERLAY_FS, FANOTIFY and\nFANOTIFY_ACCESS_PERMISSIONS: without this patch the listener's read(2)\nnever returns and the child's open is released only by the listener's\ndeath; with it read(2) returns, the event is answered and the open\ncompletes.\n\nbacking_tmpfile_open() is left alone: its only caller is\novl_create_tmpfile(), whose user file is a regular overlayfs file.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nfs: let backing files inherit FMODE_NONOTIFY from the user file\n\nWhen fanotify reports a permission event, copy_event_to_user() creates\nthe event fd with dentry_open_nonotify(), so that the listener's use of\nthat fd does not generate further events. If the event's path is on a\nstacked filesystem, the stacked filesystem's ->open() opens the real\nfile with backing_file_open(). Since commit ebe559609d78 (\"fs: get rid\nof __FMODE_NONOTIFY kludge\"), FMODE_NONOTIFY lives in f_mode only and\nthe backing file does not inherit it: it is allocated with the default\nfsnotify mode, and fsnotify_open_perm_and_set_mode() raises FS_OPEN_PERM\non the real path if the backing filesystem has permission event\nwatchers.\n\nBefore that commit __FMODE_NONOTIFY travelled in f_flags, and overlayfs\ncopies the user file's f_flags into the backing open\n(ovl_open_realfile()), so the backing file was exempt implicitly. Commit\nbc2473c90fca (\"ovl: enable fsnotify events on underlying real files\")\nrelied on that when it dropped FMODE_NONOTIFY from OVL_OPEN_FLAGS.\n\nThe nested event is queued to the same group, from inside the\nlistener's read(2), and can only be answered by another reader thread\nof that group. A listener holding filesystem marks on both the stacked\nand the backing filesystem therefore deadlocks as soon as all of its\nreader threads are inside such a read(2) at the same time, and every\nother task that touches a marked filesystem queues up behind it.\n\nObserved with a commercial anti-malware agent (16 reader threads) on an\nostree/composefs host: / is an overlayfs whose data layer is the ostree\nobject store on the same btrfs that holds /etc and /home, and a\nsystemd-sysext overlay sits on /usr. Every on-demand scan of /usr wedged\nthe whole machine until the group was killed. Stack of a blocked reader\nthread on 7.2.7:\n\n  fanotify_get_response\n  fanotify_handle_event\n  send_to_group\n  fsnotify\n  __fsnotify_parent\n  do_dentry_open\n  vfs_open\n  backing_file_open\n  ovl_open_realfile [overlay]\n  ovl_open [overlay]\n  do_dentry_open\n  vfs_open\n  backing_file_open\n  ovl_open_realfile [overlay]\n  ovl_open [overlay]\n  do_dentry_open\n  vfs_open\n  dentry_open_nonotify\n  copy_event_to_user\n  fanotify_read\n  vfs_read\n  ksys_read\n\nUserspace cannot avoid this: the backing open happens while the kernel\nbuilds the fd, before the event is reported, and fid reporting is not\navailable for permission event classes.\n\nMake a backing file inherit FMODE_NONOTIFY when the user file it is\nopened for must not generate events. This restores the pre-6.14\nbehaviour for the fds that fanotify creates (and for any other\nFMODE_NONOTIFY file), while ordinary opens through a stacked filesystem\nkeep generating events on the real path, as intended by bc2473c90fca.\n\nVerified with a self-contained reproducer (private tmpfs lower layers, an\noverlayfs over them, FAN_OPEN_PERM filesystem marks on the overlay and on\none lower layer, a child opening a file through the overlay) in a qemu\nVM on this tree built with defconfig plus OVERLAY_FS, FANOTIFY and\nFANOTIFY_ACCESS_PERMISSIONS: without this patch the listener's read(2)\nnever returns and the child's open is released only by the listener's\ndeath; with it read(2) returns, the event is answered and the open\ncompletes.\n\nbacking_tmpfile_open() is left alone: its only caller is\novl_create_tmpfile(), whose user file is a regular overlayfs file.","source":"cvelist"}],"published":"2026-11-30T13:17:21.586Z","modified":"2026-11-30T14:20:14.967Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"ebe559609d7829b52c6642b581860760984faf9d","fixed":"0da582bda88a6b0621aa9c6305354a14244bd922","status":"affected"},{"type":"git","introduced":"ebe559609d7829b52c6642b581860760984faf9d","fixed":"cee09adbabd1a15e6f22b421f836a55782ab0707","status":"affected"},{"type":"git","introduced":"ebe559609d7829b52c6642b581860760984faf9d","fixed":"c3d355f427cea70fbe31b49e21f1915dbf37f2e6","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.14","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.14","status":"unaffected"},{"type":"semver","introduced":"6.18.63","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.4","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/0da582bda88a6b0621aa9c6305354a14244bd922","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/cee09adbabd1a15e6f22b421f836a55782ab0707","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c3d355f427cea70fbe31b49e21f1915dbf37f2e6","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-99824","url":"https://www.cve.org/CVERecord?id=CVE-2026-99824","licence":"CVE Terms of Use","modified":"2026-11-30T13:17:21.586Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-99824","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99824","licence":"Public domain","modified":"2026-11-30T14:20:14.967Z"}],"updatedAt":"2026-11-30T14:33:33.202Z","epss":{"score":0.00174,"percentile":0.07147,"date":"2026-12-01T12:00:22.000Z"}}