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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 14 Sep 2010 15:36:17 -0600
From:	Andreas Dilger <adilger.kernel@...ger.ca>
To:	Jan Kara <jack@...e.cz>
Cc:	linux-ext4@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 1/2] ext3: Fix lost extented attributes for inode with ino == 11

On 2010-09-14, at 06:32, Jan Kara wrote:
> If a filesystem has inode size > 128 and someone deletes lost+found and
> reuses inode 11 for some other file, extented attributes set for this
> inode before umount will get lost after remounting the filesystem. This
> is because extended attributes will get stored in an inode but ext3_iget
> will ignore them due to workaround of a bug in an old mkfs.
> 
> Fix the problem by initializing i_extra_isize to 0 for freshly allocated
> inodes where mkfs workaround in ext3_iget applies. This way these inodes
> will always store extended attributes in a special block and no problems
> occur.
> 
> The bug was spotted and a reproduction test provided by:
>  Masayoshi MIZUMA <m.mizuma@...fujitsu.com>
> 
> CC: Andreas Dilger <adilger.kernel@...ger.ca>

Both patches now look good to me.  You can add a:

Reviewed-by: Andreas Dilger <adilger.kernel@...ger.ca>

> Signed-off-by: Jan Kara <jack@...e.cz>
> ---
> fs/ext3/ialloc.c |   11 ++++++++---
> 1 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c
> index 4ab72db..9724aef 100644
> --- a/fs/ext3/ialloc.c
> +++ b/fs/ext3/ialloc.c
> @@ -570,9 +570,14 @@ got:
> 	ei->i_state_flags = 0;
> 	ext3_set_inode_state(inode, EXT3_STATE_NEW);
> 
> -	ei->i_extra_isize =
> -		(EXT3_INODE_SIZE(inode->i_sb) > EXT3_GOOD_OLD_INODE_SIZE) ?
> -		sizeof(struct ext3_inode) - EXT3_GOOD_OLD_INODE_SIZE : 0;
> +	/* See comment in ext3_iget for explanation */
> +	if (ino >= EXT3_FIRST_INO(sb) + 1 &&
> +	    EXT3_INODE_SIZE(sb) > EXT3_GOOD_OLD_INODE_SIZE) {
> +		ei->i_extra_isize =
> +			sizeof(struct ext3_inode) - EXT3_GOOD_OLD_INODE_SIZE;
> +	} else {
> +		ei->i_extra_isize = 0;
> +	}
> 
> 	ret = inode;
> 	dquot_initialize(inode);
> -- 
> 1.6.4.2
> 

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