summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorChris Mason <clm@fb.com>2015-04-06 18:17:00 -0700
committerChris Mason <clm@fb.com>2015-04-10 14:07:29 -0700
commitcdfb080e1853660952db5e5332727e59427856df (patch)
tree43c59bd16f29e6e8fb9ff045ce20a16a4275c715 /fs/btrfs/disk-io.c
parent1bbc621ef28462456131c035eaeb5567a1a2a2fe (diff)
downloadlinux-cdfb080e1853660952db5e5332727e59427856df.tar.gz
linux-cdfb080e1853660952db5e5332727e59427856df.tar.bz2
linux-cdfb080e1853660952db5e5332727e59427856df.zip
Btrfs: fix use after free when close_ctree frees the orphan_rsv
Near the end of close_ctree, we're calling btrfs_free_block_rsv to free up the orphan rsv. The problem is this call updates the space_info, which has already been freed. This adds a new __ function that directly calls kfree instead of trying to update the space infos. Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index b5e3d5f6400a..62cd3b63190d 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3766,7 +3766,7 @@ void close_ctree(struct btrfs_root *root)
btrfs_free_stripe_hash_table(fs_info);
- btrfs_free_block_rsv(root, root->orphan_block_rsv);
+ __btrfs_free_block_rsv(root->orphan_block_rsv);
root->orphan_block_rsv = NULL;
lock_chunks(root);