# CVE-2026-46040: inotify: fix watch count leak when fsnotify\_add\_inode\_mark\_locked() fails

- Priority: **Routine**
- Reason: Not severe (CVSS 5.5, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2026-05-27 · Modified: 2026-11-10
- Aliases: UBUNTU-CVE-2026-46040, DEBIAN-CVE-2026-46040
- Record: https://cvemate.com/vulnerability/CVE-2026-46040 · JSON: https://cvemate.com/vulnerability/CVE-2026-46040/json

## Description

```text
In the Linux kernel, the following vulnerability has been resolved:

inotify: fix watch count leak when fsnotify_add_inode_mark_locked() fails

When fsnotify_add_inode_mark_locked() fails in inotify_new_watch(),
the error path calls inotify_remove_from_idr() but does not call
dec_inotify_watches() to undo the preceding inc_inotify_watches().
This leaks a watch count, and repeated failures can exhaust the
max_user_watches limit with -ENOSPC even when no watches are active.

Prior to commit 1cce1eea0aff ("inotify: Convert to using per-namespace
limits"), the watch count was incremented after fsnotify_add_mark_locked()
succeeded, so this path was not affected. The conversion moved
inc_inotify_watches() before the mark insertion without adding the
corresponding rollback.

Add the missing dec_inotify_watches() call in the error path.
```

## Signals

- CVSS: 5.5 medium (v3.1, NVD) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
- EPSS: 0.163%, percentile 5.698%, as of 2026-12-05
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 162)

- debian linux (Debian): \< 6.1.176-1 \| \< 6.12.86-1 \| \< 7.0.4-1
- ubuntu linux (Ubuntu): All versions (No fix recorded) \| \< 5.15.0-186.196 \| \< 6.8.0-136.136 \| \< 7.0.0-27.27
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): All versions (No fix recorded) \| \< 5.15.0-1112.119 \| \< 6.8.0-1061.64 \| \< 7.0.0-1008.8
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): \< 5.15.0-1112.119~20.04.1
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.4 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.14 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.17 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.5 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.8 (Ubuntu): \< 6.8.0-1061.64~22.04.1
- ubuntu linux-aws-fips (Ubuntu): All versions (No fix recorded) \| \< 5.15.0-1112.119+fips1 \| \< 6.8.0-1061.64+fips1
- ubuntu linux-aws-hwe (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure (Ubuntu): All versions (No fix recorded) \| \< 5.15.0-1117.126 \| \< 6.8.0-1063.71 \| \< 7.0.0-1010.10

## References (first 20 of 49)

- <https://git.kernel.org/stable/c/3ab58cf42c46bf2366d2f55ae5c59299d5e178b7>
- <https://git.kernel.org/stable/c/10edf7e0ffdc7faa18e2244b17722c1b882b8273>
- <https://git.kernel.org/stable/c/3ad9ccea1b25435f6179b57aa891960beb7ce8f9>
- <https://git.kernel.org/stable/c/8bcc1cd237ab5ccfdd102869fa031c541943cf40>
- <https://git.kernel.org/stable/c/73ddc8518a32baff6bc17afda4ee1ebae5b4ed12>
- <https://git.kernel.org/stable/c/fdaa42ca370d056428e5e171247c8fdce8dff36a>
- <https://git.kernel.org/stable/c/9e48844f708eb48bae4e79cb21edc097c966306d>
- <https://git.kernel.org/stable/c/6a320935fa4293e9e599ec9f85dc9eb3be7029f8>
- <https://cert-portal.siemens.com/productcert/html/ssa-019113.html>
- <https://ubuntu.com/security/CVE-2026-46040>
- <https://www.cve.org/CVERecord?id=CVE-2026-46040>
- <https://git.kernel.org/linus/6a320935fa4293e9e599ec9f85dc9eb3be7029f8>
- <https://ubuntu.com/security/notices/USN-8488-1>
- <https://ubuntu.com/security/notices/USN-8489-1>
- <https://ubuntu.com/security/notices/USN-8488-2>
- <https://ubuntu.com/security/notices/USN-8507-1>
- <https://ubuntu.com/security/notices/USN-8569-1>
- <https://ubuntu.com/security/notices/USN-8567-1>
- <https://ubuntu.com/security/notices/USN-8574-1>
- <https://ubuntu.com/security/notices/USN-8575-1>

---

Data as of 2026-12-06T04:08:40.974Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
