Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177937842
D53774.1795602465.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
609 B
Referenced Files
None
Subscribers
None
D53774.1795602465.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
Wed, Nov 25, 10:27 AM (19 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41987739
Default Alt Text
D53774.1795602465.diff (609 B)
Attached To
Mode
D53774: inotify: Work around the vput() bug directly
Attached
Detach File
Event Timeline