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
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What conditions are needed to trigger the resource exhaustion?

An attacker needs local access and the ability to create inotify watches. They must repeatedly cause fsnotify_add_inode_mark_locked() to fail; each failed attempt can leak a watch count.

2

What is the practical impact of repeated failed watch creations?

The leaked counts can exhaust the max_user_watches limit, causing subsequent watch creation attempts to fail with -ENOSPC even when no inotify watches are active. The provided data indicates availability impact only, with no confidentiality or integrity impact.

3

Are all affected kernel generations exposed to this error path?

No. The description states that kernels before commit 1cce1eea0aff were not affected because the watch count was incremented only after successful mark insertion. The affected behavior was introduced when the code was converted to per-namespace limits.

4

How can administrators recognize that this issue may already be occurring?

Affected systems may return -ENOSPC when creating inotify watches despite having no active watches. This can occur after repeated failures in the inode-mark insertion path have accumulated leaked watch counts.

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