Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146642650
D53774.id166515.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
609 B
Referenced Files
None
Subscribers
None
D53774.id166515.diff
View Options
diff --git a/sys/kern/vfs_inotify.c b/sys/kern/vfs_inotify.c
--- a/sys/kern/vfs_inotify.c
+++ b/sys/kern/vfs_inotify.c
@@ -381,7 +381,14 @@
static void
inotify_free_watch(struct inotify_watch *watch)
{
- vrele(watch->vp);
+ /*
+ * Formally, we don't need to lock the vnode here. However, if we
+ * don't, and vrele() releases the last reference, it's possible the
+ * vnode will be recycled while a different thread holds the vnode lock.
+ * Work around this bug by acquiring the lock here.
+ */
+ (void)vn_lock(watch->vp, LK_EXCLUSIVE | LK_RETRY);
+ vput(watch->vp);
free(watch, M_INOTIFY);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 5, 8:56 AM (20 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29279176
Default Alt Text
D53774.id166515.diff (609 B)
Attached To
Mode
D53774: inotify: Work around the vput() bug directly
Attached
Detach File
Event Timeline
Log In to Comment