CVE-2026-46040

Source
https://cve.org/CVERecord?id=CVE-2026-46040
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-46040.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2026-46040
Downstream
Related
Published
2026-05-27T12:56:52.161Z
Modified
2026-06-18T03:56:34.283621010Z
Summary
inotify: fix watch count leak when fsnotify_add_inode_mark_locked() fails
Details

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

inotify: fix watch count leak when fsnotifyaddinodemarklocked() fails

When fsnotifyaddinodemarklocked() fails in inotifynewwatch(), the error path calls inotifyremovefromidr() but does not call decinotifywatches() to undo the preceding incinotifywatches(). This leaks a watch count, and repeated failures can exhaust the maxuser_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 fsnotifyaddmarklocked() succeeded, so this path was not affected. The conversion moved incinotify_watches() before the mark insertion without adding the corresponding rollback.

Add the missing decinotifywatches() call in the error path.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46040.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
1cce1eea0aff51201753fcaca421df825b0813b6
Fixed
3ab58cf42c46bf2366d2f55ae5c59299d5e178b7
Fixed
10edf7e0ffdc7faa18e2244b17722c1b882b8273
Fixed
3ad9ccea1b25435f6179b57aa891960beb7ce8f9
Fixed
8bcc1cd237ab5ccfdd102869fa031c541943cf40
Fixed
73ddc8518a32baff6bc17afda4ee1ebae5b4ed12
Fixed
fdaa42ca370d056428e5e171247c8fdce8dff36a
Fixed
9e48844f708eb48bae4e79cb21edc097c966306d
Fixed
6a320935fa4293e9e599ec9f85dc9eb3be7029f8

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-46040.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
4.11.0
Fixed
5.10.258
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.209
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.175
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.140
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.86
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.18.27
Type
ECOSYSTEM
Events
Introduced
6.19.0
Fixed
7.0.4

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-46040.json"