CVE-2026-46040
inotify: fix watch count leak when fsnotify_add_inode_mark_locked() fails
Reported by linux · Published May 27, 2026
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| kernel6.12-modules-extra-common | Amazon Linux | 1:6.12.88-119.157.amzn2023 |
| kernel-livepatch-6.18.30-61.116 | Amazon Linux | 1:1.0-0.amzn2023 |
| perf6.18 | Amazon Linux | 1:6.18.30-61.116.amzn2023 |
| bpftool6.12 | Amazon Linux | 1:6.12.88-119.157.amzn2023 |
| kernel-livepatch-6.1.175-219.357 | Amazon Linux | 1:1.0-0.amzn2023 |
| perf | Amazon Linux | 1:6.1.175-219.357.amzn2023 |
| kernel6.18 | Amazon Linux | 1:6.18.30-61.116.amzn2023 |
| kernel6.18-devel | Amazon Linux | 1:6.18.30-61.116.amzn2023 |
| python3-perf6.18 | Amazon Linux | 1:6.18.30-61.116.amzn2023 |
| kernel6.12-tools | Amazon Linux | 1:6.12.88-119.157.amzn2023 |
| bpftool6.18 | Amazon Linux | 1:6.18.30-61.116.amzn2023 |
| kernel6.18-headers | Amazon Linux | 1:6.18.30-61.116.amzn2023 |
19 more packages have a fixed version. See every fix in Lookup.
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 1cce1eea0aff51201753fcaca421df825b0813b6, 1cce1eea0aff51201753fcaca421df825b0813b6, 1cce1eea0aff51201753fcaca421df825b0813b6 |
| Linux | Linux | 4.11, 0, 5.10.258 |
| amazon:2023 | kernel6.12-modules-extra-common | 0 |
| amazon:2023 | kernel-livepatch-6.18.30-61.116 | 0 |
| amazon:2023 | perf6.18 | 0 |
| amazon:2023 | bpftool6.12 | 0 |
| amazon:2023 | kernel-livepatch-6.1.175-219.357 | 0 |
| amazon:2023 | perf | 0 |
| amazon:2023 | kernel6.18 | 0 |
| amazon:2023 | kernel6.18-devel | 0 |
| amazon:2023 | python3-perf6.18 | 0 |
| amazon:2023 | kernel6.12-tools | 0 |
| Siemens | SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP | 3.1.7, 3.1.6 |
| amazon:2023 | bpftool6.18 | 0 |
| amazon:2023 | kernel6.18-headers | 0 |
| amazon:2023 | kernel6.18-tools-devel | 0 |
| Siemens | SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AC0) | 3.1.6, 3.1.7 |
| amazon:2023 | kernel-tools-devel | 0 |
| Siemens | SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AB0) | 3.1.7, 3.1.6 |
| amazon:2023 | kernel-modules-extra-common | 0 |
…and 26 more
Timeline
- May 27, 2026 CVE Published
- May 28, 2026 EPSS Score (16 in total, the first dated here)
- May 29, 2026 Security Advisory (131 in total, the first dated here)
- Jun 4, 2026 Coalition ESS Score
- Aug 11, 2026 Distribution Patch (128 in total, the first dated here)
- Sep 16, 2026 CVE Updated
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2026-46040
vulnetix vdb fixes CVE-2026-46040
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2026-46040/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart