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)
Sun, Oct 12, 11:03 PM
Unknown Object (File)
Sun, Oct 12, 11:03 PM
Unknown Object (File)
Sun, Oct 12, 11:03 PM
Unknown Object (File)
Sun, Oct 12, 11:03 PM
Unknown Object (File)
Sun, Oct 12, 11:36 AM
Unknown Object (File)
Sun, Oct 5, 3:49 AM
Unknown Object (File)
Mon, Sep 29, 1:58 PM
Unknown Object (File)
Wed, Sep 24, 1:05 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.