rpms/kernel/devel linux-2.6-ext34-xattr-fix.patch, NONE, 1.1 kernel.spec, 1.632, 1.633 linux-2.6-ext4-stable-queue.patch, 1.3, NONE

Eric Sandeen (sandeen) fedora-extras-commits at redhat.com
Thu May 15 21:22:17 UTC 2008


Author: sandeen

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31838

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-ext34-xattr-fix.patch 
Removed Files:
	linux-2.6-ext4-stable-queue.patch 
Log Message:
* Thu May 15 2008 Eric Sandeen <esandeen at redhat.com>
- ext3/4: fix uninitialized bs in ext3/4_xattr_set_handle()


linux-2.6-ext34-xattr-fix.patch:

--- NEW FILE linux-2.6-ext34-xattr-fix.patch ---
>From stable-bounces at linux.kernel.org Wed May 14 19:45:26 2008
From: Tiger Yang <tiger.yang at oracle.com>
Date: Thu, 15 May 2008 02:45:18 GMT
Subject: ext3/4: fix uninitialized bs in ext3/4_xattr_set_handle()
To: jejb at kernel.org, stable at kernel.org
Message-ID: <200805150245.m4F2jI8E020348 at hera.kernel.org>

From: Tiger Yang <tiger.yang at oracle.com>

commit 7e01c8e5420b6c7f9d85d34c15d8c7a15c9fc720 upstream

This fix the uninitialized bs when we try to replace a xattr entry in
ibody with the new value which require more than free space.

This situation only happens we format ext3/4 with inode size more than 128 and
we have put xattr entries both in ibody and block.  The consequences about
this bug is we will lost the xattr block which pointed by i_file_acl with all
xattr entires in it.  We will alloc a new xattr block and put that large value
entry in it.  The old xattr block will become orphan block.

Signed-off-by: Tiger Yang <tiger.yang at oracle.com>
Cc: <linux-ext4 at vger.kernel.org>
Cc: Andreas Gruenbacher <agruen at suse.de>
Acked-by: Andreas Dilger <adilger at sun.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>

---
 fs/ext3/xattr.c |    5 +++++
 fs/ext4/xattr.c |    5 +++++
 2 files changed, 10 insertions(+)

--- a/fs/ext3/xattr.c
+++ b/fs/ext3/xattr.c
@@ -1000,6 +1000,11 @@ ext3_xattr_set_handle(handle_t *handle, 
 			i.value = NULL;
 			error = ext3_xattr_block_set(handle, inode, &i, &bs);
 		} else if (error == -ENOSPC) {
+			if (EXT3_I(inode)->i_file_acl && !bs.s.base) {
+				error = ext3_xattr_block_find(inode, &i, &bs);
+				if (error)
+					goto cleanup;
+			}
 			error = ext3_xattr_block_set(handle, inode, &i, &bs);
 			if (error)
 				goto cleanup;
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -1011,6 +1011,11 @@ ext4_xattr_set_handle(handle_t *handle, 
 			i.value = NULL;
 			error = ext4_xattr_block_set(handle, inode, &i, &bs);
 		} else if (error == -ENOSPC) {
+			if (EXT4_I(inode)->i_file_acl && !bs.s.base) {
+				error = ext4_xattr_block_find(inode, &i, &bs);
+				if (error)
+					goto cleanup;
+			}
 			error = ext4_xattr_block_set(handle, inode, &i, &bs);
 			if (error)
 				goto cleanup;



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.632
retrieving revision 1.633
diff -u -r1.632 -r1.633
--- kernel.spec	14 May 2008 20:13:11 -0000	1.632
+++ kernel.spec	15 May 2008 21:21:31 -0000	1.633
@@ -649,8 +649,8 @@
 # atl2 network driver
 Patch2020: linux-2.6-netdev-atl2.patch
 
-# ext4 patches
-Patch2100: linux-2.6-ext4-stable-queue.patch
+# ext[34] patches
+Patch2100: linux-2.6-ext34-xattr-fix.patch
 
 # linux1394 git patches
 Patch2200: linux-2.6-firewire-git-update.patch
@@ -1179,6 +1179,9 @@
 
 ApplyPatch linux-2.6-netdev-atl2.patch
 
+# ext[34] fixes
+ApplyPatch linux-2.6-ext34-xattr-fix.patch
+
 # Nouveau DRM + drm fixes
 ApplyPatch linux-2.6-drm-git-mm.patch
 ApplyPatch nouveau-drm.patch
@@ -1800,6 +1803,9 @@
 %kernel_variant_files -a /%{image_install_path}/xen*-%{KVERREL}.xen -e /etc/ld.so.conf.d/kernelcap-%{KVERREL}.xen.conf %{with_xen} xen
 
 %changelog
+* Thu May 15 2008 Eric Sandeen <esandeen at redhat.com>
+- ext3/4: fix uninitialized bs in ext3/4_xattr_set_handle()
+
 * Wed May 14 2008 Eric Paris <eparis at redhat.com>
 - fix may sleep in allocation for previous deffered context patch
 - replace selinux specific knowledge of ioctls with a generic ioctl implementation


--- linux-2.6-ext4-stable-queue.patch DELETED ---




More information about the fedora-extras-commits mailing list