DragonFlyBSD Kernel Audit
DF-3032 / fix.diff
← back to finding ↓ download raw
--- a/sys/vfs/ext2fs/ext2_vnops.c
+++ b/sys/vfs/ext2fs/ext2_vnops.c
@@ -1025,6 +1025,9 @@
 	if (xp != ip) {
 		/*
 		 * From name resolves to a different inode.  IN_RENAME is
 		 * not sufficient protection against timing window races
 		 * so we can't panic here.
 		 */
+		if (doingdirectory)
+			ip->i_flag &= ~IN_RENAME;
 	} else {
 		/*
 		 * If the source is a directory with a