Re: [PATCH] Endianness bugs in e2fsck

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2007-07-17 at 20:40 -0500, Eric Sandeen wrote:
> Eric Sandeen wrote:
> ---------
> 
> set t->i_file_acl before we test it in 
> ext2fs_inode_data_blocks
> 
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> 
> Index: e2fsprogs-1.40.2/lib/ext2fs/swapfs.c
> ===================================================================
> --- e2fsprogs-1.40.2.orig/lib/ext2fs/swapfs.c
> +++ e2fsprogs-1.40.2/lib/ext2fs/swapfs.c
> @@ -150,6 +150,7 @@ void ext2fs_swap_inode_full(ext2_filsys 
>  	t->i_dtime = ext2fs_swab32(f->i_dtime);
>  	t->i_gid = ext2fs_swab16(f->i_gid);
>  	t->i_links_count = ext2fs_swab16(f->i_links_count);
> +	t->i_file_acl = ext2fs_swab32(f->i_file_acl);
>  	if (hostorder)
>  		has_data_blocks = ext2fs_inode_data_blocks(fs, 
>  					   (struct ext2_inode *) f);
> @@ -158,7 +159,6 @@ void ext2fs_swap_inode_full(ext2_filsys 
>  		has_data_blocks = ext2fs_inode_data_blocks(fs, 
>  					   (struct ext2_inode *) t);
>  	t->i_flags = ext2fs_swab32(f->i_flags);
> -	t->i_file_acl = ext2fs_swab32(f->i_file_acl);
>  	t->i_dir_acl = ext2fs_swab32(f->i_dir_acl);
>  	if (!islnk || has_data_blocks ) {
> 
> 
>  		for (i = 0; i < EXT2_N_BLOCKS; i++)

This means that on big-endian machines, t->i_file_acl was uninitialized
when it was being accessed here. This certainly seems to be the correct
fix for this.

Thanks,
Kalpak.

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

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux