lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <47C882CD.3090204@redhat.com>
Date:	Fri, 29 Feb 2008 16:10:21 -0600
From:	Eric Sandeen <sandeen@...hat.com>
To:	ext4 development <linux-ext4@...r.kernel.org>
Subject: [PATCH] e2fsprogs- fix ext2fs_swap_inode_full attr test on BE boxes

After the fix for resize2fs's inode mover losing in-inode
extended attributes, the regression test I wrote caught 
that the attrs were still getting lost on powerpc.

Looks like the problem is that ext2fs_swap_inode_full()
isn't paying attention to whether or not the EA magic is
in hostorder, so it's not recognized (and not swapped)
on BE machines.  Patch below seems to fix it.

Yay for regression tests.  ;)

Signed-off-by: Eric Sandeen <sandeen@...hat.com>
---

Index: e2fsprogs-1.40.7/lib/ext2fs/swapfs.c
===================================================================
--- e2fsprogs-1.40.7.orig/lib/ext2fs/swapfs.c
+++ e2fsprogs-1.40.7/lib/ext2fs/swapfs.c
@@ -133,7 +133,7 @@ void ext2fs_swap_inode_full(ext2_filsys 
 			    struct ext2_inode_large *f, int hostorder,
 			    int bufsize)
 {
-	unsigned i, has_data_blocks, extra_isize;
+	unsigned i, has_data_blocks, extra_isize, attr_magic;
 	int islnk = 0;
 	__u32 *eaf, *eat;
 
@@ -231,13 +231,17 @@ void ext2fs_swap_inode_full(ext2_filsys 
 
 	eaf = (__u32 *) (((char *) f) + sizeof(struct ext2_inode) +
 					extra_isize);
-
-	if (ext2fs_swab32(*eaf) != EXT2_EXT_ATTR_MAGIC)
-		return; /* it seems no magic here */
-
 	eat = (__u32 *) (((char *) t) + sizeof(struct ext2_inode) +
 					extra_isize);
+
+	if (hostorder)
+		attr_magic = *eaf;
 	*eat = ext2fs_swab32(*eaf);
+	if (!hostorder)
+		attr_magic = *eat;
+
+	if (attr_magic != EXT2_EXT_ATTR_MAGIC)
+		return; /* it seems no magic here */
 
 	/* convert EA(s) */
 	ext2fs_swap_ext_attr((char *) (eat + 1), (char *) (eaf + 1),

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ