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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1259526809-23697-2-git-send-email-tytso@mit.edu>
Date:	Sun, 29 Nov 2009 15:33:26 -0500
From:	Theodore Ts'o <tytso@....edu>
To:	Ext4 Developers List <linux-ext4@...r.kernel.org>
Cc:	Theodore Ts'o <tytso@....edu>
Subject: [PATCH 2/5] libext2fs: Fix SET_BMAP bugs in ext2fs_bmap() and ext2fs_bmap2()

Don't byte-swap the block number when setting i_block[x], since the
write_inode function will take of byte swapping the inode.

The phys_blk parameter contains an input parameter in the SET_BMAP
case, so it must be passed to ext2fs_bmap2() from the legacy function
ext2fs_bmap().

Signed-off-by: "Theodore Ts'o" <tytso@....edu>
---
 lib/ext2fs/bmap.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/lib/ext2fs/bmap.c b/lib/ext2fs/bmap.c
index 2a86439..933036b 100644
--- a/lib/ext2fs/bmap.c
+++ b/lib/ext2fs/bmap.c
@@ -214,9 +214,6 @@ errcode_t ext2fs_bmap2(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode,
 	if (block < EXT2_NDIR_BLOCKS) {
 		if (bmap_flags & BMAP_SET) {
 			b = *phys_blk;
-#ifdef WORDS_BIGENDIAN
-			b = ext2fs_swab32(b);
-#endif
 			inode_bmap(inode, block) = b;
 			inode_dirty++;
 			goto done;
@@ -325,7 +322,7 @@ errcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode,
 		      blk_t *phys_blk)
 {
 	errcode_t ret;
-	blk64_t	ret_blk;
+	blk64_t	ret_blk = *phys_blk;
 
 	ret = ext2fs_bmap2(fs, ino, inode, block_buf, bmap_flags, block,
 			    0, &ret_blk);
-- 
1.6.5.216.g5288a.dirty

--
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