CVE-2026-46040: inotify: fix watch count leak when fsnotify_add_inode_mark_locked() fails

Published May 27, 2026
·
Updated

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 maxuserwatches 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 incinotifywatches() before the mark insertion without adding the corresponding rollback.

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

Affected Software

9 affected componentsFixes available
Linux Linux kernel
Linux Linux kernel>=4.11<5.10.258
Linux Linux kernel>=5.11<5.15.209
Linux Linux kernel>=5.16<6.1.175
Linux Linux kernel>=6.2<6.6.140
Linux Linux kernel>=6.7<6.12.86
Linux Linux kernel>=6.13<6.18.27
Linux Linux kernel>=6.19<7.0.4
Microsoft azl3 kernel 6.6.139.1-1<6.6.141.1-1
6.6.141.1-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 6.6.141.1-1
  2. Upgrade

    Upgrade Linux kernel inotify: fix watch count leak when fsnotify_add_inode_mark_locked() fails to a version that resolves this vulnerability.

    Patch 1cce1eea0aff

Event History

May 27, 2026
CVE Published
via MITRE·12:56 PM
Data Sourced
via MITRE·12:56 PM
Description
Data Sourced
via NVD·02:17 PM
RemedyDescriptionSeverityAffected Software
May 28, 2026
Data Sourced
via Microsoft·08:08 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·08:08 AM
Affected Software
Updated
via Microsoft·08:08 AM
DescriptionSeverity

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203