In the Linux kernel, the following vulnerability has been resolved:
fsnotify: clear PARENT_WATCHED flags lazily
In some setups directories can have many (usually negative) dentries. Hence _fsnotifyupdatechilddentryflags() function can take a significant amount of time. Since the bulk of this function happens under inode->ilock this causes a significant contention on the lock when we remove the watch from the directory as the _fsnotifyupdatechilddentryflags() call from fsnotifyrecalcmask() races with _fsnotifyupdatechilddentryflags() calls from _fsnotifyparent() happening on children. This can lead upto softlockup reports reported by users.
Fix the problem by calling fsnotifyupdatechildrendentryflags() to set PARENT_WATCHED flags only when parent starts watching children.
When parent stops watching children, clear false positive PARENTWATCHED flags lazily in _fsnotify_parent() for each accessed child.