# CVE-2026-138876: fanotify: report names longer than NAME_MAX

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.22%, higher than 13% of CVEs (2026-12-01)
- Published: 2026-11-30T13:25:48.795Z
- Modified: 2026-11-30T14:17:44.620Z
- Assigned by: Linux

## 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.

(As written by CVE List.)

## Affected

- Linux Linux: from 4e63ce91997a6ac8b8337e87aafb539590ba9ae9 before a561f301ffb248615070a200cd22136cd671b64a; from 3eec21b660856c7af1278a07cf668a680c582bde before ed70c92b58ab28d4e448b9d5f191e989e1f420a3; from 2d9374f095136206a02eb0b6cd9ef94632c1e9f7 before acdb65f153154e013d428a45627deb98fbbfef8f; from 2d9374f095136206a02eb0b6cd9ef94632c1e9f7 before 71a52b4cf6ca0316bad296a634598ad82baac6e3; from 2d9374f095136206a02eb0b6cd9ef94632c1e9f7 before 460792f7ecbcecc94e4d938063d76c555a73c2bb; from 2d9374f095136206a02eb0b6cd9ef94632c1e9f7 before 82c9bc868b49d87893ef3ce8c09ff21300dcb50e; from 2d9374f095136206a02eb0b6cd9ef94632c1e9f7 before dba1adf68bc63649994e0e45e74fa6d97416013b; from 2d9374f095136206a02eb0b6cd9ef94632c1e9f7 before ff05910cb1b77c2b229c5e6e260c6173a17b579b; from 5.10.220 before 5.10.275; from 5.15.154 before 5.15.226; 5.17 (not affected: before 5.17; from 5.10.275 up to 5.10.*; from 5.15.226 up to 5.15.*; from 6.1.193 up to 6.1.*; from 6.6.163 up to 6.6.*; from 6.12.117 up to 6.12.*; from 6.18.63 up to 6.18.*; from 7.3.4 up to 7.3.*; from 7.4-rc1 up to *)

## References

- <https://git.kernel.org/stable/c/a561f301ffb248615070a200cd22136cd671b64a>
- <https://git.kernel.org/stable/c/ed70c92b58ab28d4e448b9d5f191e989e1f420a3>
- <https://git.kernel.org/stable/c/acdb65f153154e013d428a45627deb98fbbfef8f>
- <https://git.kernel.org/stable/c/71a52b4cf6ca0316bad296a634598ad82baac6e3>
- <https://git.kernel.org/stable/c/460792f7ecbcecc94e4d938063d76c555a73c2bb>
- <https://git.kernel.org/stable/c/82c9bc868b49d87893ef3ce8c09ff21300dcb50e>
- <https://git.kernel.org/stable/c/dba1adf68bc63649994e0e45e74fa6d97416013b>
- <https://git.kernel.org/stable/c/ff05910cb1b77c2b229c5e6e260c6173a17b579b>

## Sources

- CVE List: [CVE-2026-138876](https://www.cve.org/CVERecord?id=CVE-2026-138876), CVE Terms of Use, modified 2026-11-30
- NVD: [CVE-2026-138876](https://nvd.nist.gov/vuln/detail/CVE-2026-138876), Public domain, modified 2026-11-30

---

Page: https://cve.day/CVE-2026-138876 · Whole record: https://cve.day/CVE-2026-138876.json · Rebuilt by cve.day 2026-11-30T14:32:31.163Z
