Accepting request 41263 from filesystems

checked in (request 41263)

OBS-URL: https://build.opensuse.org/request/show/41263
OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=96
This commit is contained in:
OBS User autobuild 2010-06-09 14:56:50 +00:00 committed by Git OBS Bridge
parent 36ce606d08
commit 6d78376d85
3 changed files with 2 additions and 54 deletions

View File

@ -1,39 +0,0 @@
From: Jeff Mahoney <jeffm@suse.com>
Subject: btrfsprogs: Fix use after free in close_ctree
References: bnc#603620
After the roots are closed, root is freed. Yet close_ctree continues
to use it. It works generally because no new memory is allocated in
the interim, but with glibc malloc perturbing enabled, it crashes
every time. This is because root->fs_info points to garbage.
This patch uses the already-cached fs_info variable for the rest of
the accesses and fixes the crash.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
disk-io.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/disk-io.c
+++ b/disk-io.c
@@ -971,13 +971,13 @@ int close_ctree(struct btrfs_root *root)
if (fs_info->csum_root->node)
free_extent_buffer(fs_info->csum_root->node);
- if (root->fs_info->log_root_tree) {
- if (root->fs_info->log_root_tree->node)
- free_extent_buffer(root->fs_info->log_root_tree->node);
- free(root->fs_info->log_root_tree);
+ if (fs_info->log_root_tree) {
+ if (fs_info->log_root_tree->node)
+ free_extent_buffer(fs_info->log_root_tree->node);
+ free(fs_info->log_root_tree);
}
- close_all_devices(root->fs_info);
+ close_all_devices(fs_info);
extent_io_tree_cleanup(&fs_info->extent_cache);
extent_io_tree_cleanup(&fs_info->free_space_cache);
extent_io_tree_cleanup(&fs_info->block_group_cache);

View File

@ -1,13 +1,3 @@
-------------------------------------------------------------------
Wed May 26 17:00:46 CEST 2010 - dmueller@suse.de
- fix crash on creating filesystems (bnc#603620)
-------------------------------------------------------------------
Fri May 7 15:05:11 CEST 2010 - dmueller@suse.de
- revert last change (bnc#599224#c3)
-------------------------------------------------------------------
Thu Apr 29 11:11:13 CEST 2010 - dmueller@suse.de

View File

@ -32,7 +32,6 @@ Patch2: 0002-btrfsctl-add-snapshot-subvolume-destroy-ioctl.patch
Patch3: 0003-btrfsck-check-root-back-forward-references.patch
Patch4: 0004-Add-btrfs-map-logical-program-to-map-and-read-logica.patch
Patch5: 0001-Plug-Memory-leak-in-find_and_setup_log_root.patch
Patch6: 0005-fix-use-after-free.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: libacl-devel libext2fs-devel libuuid-devel zlib-devel
@ -48,15 +47,13 @@ file systems.
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%build
make %{?jobs:-j%jobs} CFLAGS="%{optflags}" all convert
%install
make install DESTDIR=${RPM_BUILD_ROOT} prefix=%{_prefix} bindir=/sbin mandir=%{_mandir}
# command line options are not compatible (bnc#599224)
#ln ${RPM_BUILD_ROOT}/sbin/btrfsck ${RPM_BUILD_ROOT}/sbin/fsck.btrfs
ln ${RPM_BUILD_ROOT}/sbin/btrfsck ${RPM_BUILD_ROOT}/sbin/fsck.btrfs
%files
%defattr(-, root, root)
@ -67,7 +64,7 @@ make install DESTDIR=${RPM_BUILD_ROOT} prefix=%{_prefix} bindir=/sbin mandir=%{_
/sbin/btrfsck
/sbin/btrfsctl
/sbin/mkfs.btrfs
#/sbin/fsck.btrfs
/sbin/fsck.btrfs
/sbin/btrfs-map-logical
%_mandir/man8/btrfs-image.8.gz
%_mandir/man8/btrfs-show.8.gz