Author: pschweitzer
Date: Tue May 10 21:07:56 2016
New Revision: 71314
URL:
http://svn.reactos.org/svn/reactos?rev=71314&view=rev
Log:
[BTRFS]
Cherry pick aa04ca0ea4cadb0c70ff6d659916cc98b7b02c27: uninit: don't free roots before
FCBs are freed
This avoids use-after-free on shutdown
Modified:
trunk/reactos/drivers/filesystems/btrfs/btrfs.c
Modified: trunk/reactos/drivers/filesystems/btrfs/btrfs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/btrfs/…
==============================================================================
--- trunk/reactos/drivers/filesystems/btrfs/btrfs.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/btrfs/btrfs.c [iso-8859-1] Tue May 10 21:07:56 2016
@@ -2374,6 +2374,13 @@
release_tree_lock(Vcb, TRUE);
}
+
+ // FIXME - stop async threads
+
+ free_fcb(Vcb->volume_fcb);
+ free_fileref(Vcb->root_fileref);
+
+ // FIXME - free any open fcbs?
while (!IsListEmpty(&Vcb->roots)) {
LIST_ENTRY* le = RemoveHeadList(&Vcb->roots);
@@ -2401,9 +2408,6 @@
ExFreePool(c->chunk_item);
ExFreePool(c);
}
-
- free_fcb(Vcb->volume_fcb);
- free_fileref(Vcb->root_fileref);
for (i = 0; i < Vcb->superblock.num_devices; i++) {
while (!IsListEmpty(&Vcb->devices[i].disk_holes)) {