CVE-2026-138876

fanotify: report names longer than NAME_MAX

Published Nov 30, 2026 CVSS 3.1 · 5.5 Medium EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

fanotify: report names longer than NAME_MAX

fanotify keeps the length of a reported name in a u8, so it drops any
name longer than NAME_MAX and warns:

WARNING: fs/notify/fanotify/fanotify.h:217 at fanotify_handle_event+0x2e82/0x39f0

Such names are legitimate on some filesystems. vfat mounted with utf8
takes up to 255 UTF-16 characters, which are up to 765 bytes of UTF-8,
and FUSE accepts names up to PATH_MAX - 1. readdir() and inotify report
them in full. fanotify sends the event without the name, and for
FAN_RENAME it trips a second warning in copy_fid_info_to_user(), after
which read() fails with EFAULT and the event is lost.

When syzbot hit this, Jan suggested accommodating names up to PATH_MAX
[1], the limit readdir() already applies to a name
(verify_dirent_name()). Store the name lengths as u16, which keeps
struct fanotify_info at 8 bytes, and drop without a warning only names
of PATH_MAX bytes or more, which no path can refer to. An event with
such a name can exceed a page, so allocate name events with kvmalloc(),
as Jan also suggested. Names up to NAME_MAX are reported exactly as
before, and the record format is unchanged: an event with a long name is
just longer.

Analysis

AI-generated

Technical impact

The kernel normally delivers fanotify event information to user space through a fixed‑size structure that includes a u8 field for the event name length. When the name exceeds the 255‑byte boundary that a u8 can represent, the kernel truncates the length and suppresses the name entirely, logging a warning and later causing read() to return EFAULT. The bug is triggered by filesystems that allow long names, such as vfat UTF‑8 drives or FUSE mounts, and results in legitimate fanotify events being dropped. The flaw does not expose kernel memory to user space but can be used to interfere with applications that rely on fanotify, effectively denying them visibility into file system changes.

Affected Systems

The affected product is the Linux kernel itself; all distributions shipping a kernel before the commit that increases name length storage and adds kvmalloc allocation are vulnerable. Because the problem originates in the core kernel, any system that runs an unpatched kernel is exposed, regardless of distribution or version. The specific kernel revisions are not enumerated in the advisory, so users should verify that their running kernel includes the fanotify length change or upgrade to a kernel version that contains the fix.

Risk and Exploitability

No EPSS score or KEV listing is provided, and there is no indication that the flaw has been observed in the wild. The risk is primarily a denial‑of‑service to fanotify users rather than a confidential data breach or arbitrary code execution. The CVSS score is not supplied, but the absence of known exploits and minimal exploit complexity diminish the likelihood of immediate attacks. Nevertheless, because the issue can disrupt critical file‑system monitoring functions, it is prudent to address it as soon as a kernel update containing the fix becomes available.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the Linux kernel to a version that includes the fanotify length storage fix
  • If an update cannot be applied immediately, disable fanotify usage on systems where the feature is not required
  • Confirm that no fanotify warning messages appear in kernel logs and that user‑space components that rely on fanotify function correctly after the update.

Generated by OpenCVE AI on November 30, 2026 at 17:47 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Linux linux
Vendors & Products Linux linux
Type Values Removed Values Added
Weaknesses CWE-617
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.5, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H'}

threat_severity

Moderate

Type Values Removed Values Added
Weaknesses CWE-680
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: fanotify: report names longer than NAME_MAX fanotify keeps the length of a reported name in a u8, so it drops any name longer than NAME_MAX and warns: WARNING: fs/notify/fanotify/fanotify.h:217 at fanotify_handle_event+0x2e82/0x39f0 Such names are legitimate on some filesystems. vfat mounted with utf8 takes up to 255 UTF-16 characters, which are up to 765 bytes of UTF-8, and FUSE accepts names up to PATH_MAX - 1. readdir() and inotify report them in full. fanotify sends the event without the name, and for FAN_RENAME it trips a second warning in copy_fid_info_to_user(), after which read() fails with EFAULT and the event is lost. When syzbot hit this, Jan suggested accommodating names up to PATH_MAX [1], the limit readdir() already applies to a name (verify_dirent_name()). Store the name lengths as u16, which keeps struct fanotify_info at 8 bytes, and drop without a warning only names of PATH_MAX bytes or more, which no path can refer to. An event with such a name can exceed a page, so allocate name events with kvmalloc(), as Jan also suggested. Names up to NAME_MAX are reported exactly as before, and the record format is unchanged: an event with a long name is just longer.
Title fanotify: report names longer than NAME_MAX
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-617

    Reachable Assertion

  • CWE-680

    Integer Overflow to Buffer Overflow

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:25 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:17 PM
Modified
Nov 30, 2026, 2:17 PM
Severity
Moderate
Public date
Nov 30, 2026, 1:25 PM