Page MenuHomeFreeBSD

inotify: Fix a couple of locking bugs
ClosedPublic

Authored by markj on Jul 18 2025, 1:22 AM.
Tags
None
Referenced Files
F140901923: D51401.diff
Mon, Dec 29, 10:36 AM
Unknown Object (File)
Fri, Dec 19, 2:54 PM
Unknown Object (File)
Thu, Dec 11, 1:04 PM
Unknown Object (File)
Wed, Dec 3, 11:04 PM
Unknown Object (File)
Nov 25 2025, 1:22 PM
Unknown Object (File)
Nov 24 2025, 3:56 PM
Unknown Object (File)
Nov 17 2025, 7:40 AM
Unknown Object (File)
Nov 7 2025, 3:20 AM
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.