https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e08dc305696616b7d52e7…
commit e08dc305696616b7d52e7e7591c1810e2e8f2ff6
Author: Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr>
AuthorDate: Sat Sep 7 02:38:46 2019 +0200
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sat Sep 7 19:58:03 2019 +0200
[BTRFS] Revert "Leak the root stream file object on mount."
Not needed anymore.
This reverts commit c13ccc92f66d9fd537ffdd4c0324af5b9c2723e1.
---
drivers/filesystems/btrfs/btrfs.c | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/drivers/filesystems/btrfs/btrfs.c b/drivers/filesystems/btrfs/btrfs.c
index 61f3dc666db..ada1cc18f45 100644
--- a/drivers/filesystems/btrfs/btrfs.c
+++ b/drivers/filesystems/btrfs/btrfs.c
@@ -4785,21 +4785,7 @@ static NTSTATUS mount_vol(_In_ PDEVICE_OBJECT DeviceObject, _In_
PIRP Irp) {
goto exit;
}
- /* HACK: stream file object seems to get deleted at some point
- * leading to use after free when installing ReactOS on
- * BtrFS.
- * Workaround: leak a handle to the fileobject
- * XXX: Could be improved by storing it somewhere and releasing it
- * on dismount. Or even by referencing again the file object.
- */
-#ifndef __REACTOS__
Vcb->root_file = IoCreateStreamFileObject(NULL, DeviceToMount);
-#else
- {
- HANDLE Dummy;
- Vcb->root_file = IoCreateStreamFileObjectEx(NULL, DeviceToMount, &Dummy);
- }
-#endif
Vcb->root_file->FsContext = root_fcb;
Vcb->root_file->SectionObjectPointer =
&root_fcb->nonpaged->segment_object;
Vcb->root_file->Vpb = DeviceObject->Vpb;