Page MenuHomeFreeBSD

inotify: Fix a couple of locking bugs
ClosedPublic

Authored by markj on Jul 18 2025, 1:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 25, 1:22 PM
Unknown Object (File)
Mon, Nov 24, 3:56 PM
Unknown Object (File)
Mon, Nov 17, 7:40 AM
Unknown Object (File)
Fri, Nov 7, 3:20 AM
Unknown Object (File)
Thu, Nov 6, 6:55 PM
Unknown Object (File)
Oct 29 2025, 3:58 AM
Unknown Object (File)
Oct 29 2025, 12:17 AM
Unknown Object (File)
Oct 27 2025, 1:31 PM
Subscribers

Details

Summary

When hooking vop_rename_post(), the preexisting dst vnode will be
unlocked. But, we need to invoke VOP_GETATTR on it in vn_inotify() to
check its link count.

In inotify_unlink_watch_locked(), the vnode interlock is not held, so
don't use vn_irflag_unset_locked().

Fixes: f1f230439fa4 ("vfs: Initial revision of inotify")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Jul 18 2025, 1:22 AM
sys/sys/inotify.h
110

_[A_Z]* are not good names for global macros.
I suggest e.g. INOTIFY_NAME_LOCK() or similar.

117

Same as () are not needed in around vp/dvp in lines 111/112.

markj marked 2 inline comments as done.

Handle kib's notes.

This revision is now accepted and ready to land.Jul 18 2025, 1:55 PM
This revision was automatically updated to reflect the committed changes.