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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20071121214327.GC3116@webber.adilger.int>
Date:	Wed, 21 Nov 2007 14:43:27 -0700
From:	Andreas Dilger <adilger@....com>
To:	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
Cc:	linux-ext4@...r.kernel.org
Subject: Re: [PATCH] ext4: add block bitmap validation

On Nov 19, 2007  20:26 +0530, Aneesh Kumar K.V wrote:
> +static int ext4_valid_block_bitmap(struct super_block *sb,
> +					struct ext4_group_desc *desc,
> +					unsigned int block_group,
> +					struct buffer_head *bh)
> +{
> +	if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG)) {
> +		/* with FLEX_BG, the inode/block bitmaps and itable
> +		 * blocks may not be in the group at all
> +		 * so the bitmap validation will be skipped for those groups
> +		 * or it has to also read the block group where the bitmaps
> +		 * are located to verify they are set.
> +		 */
> +		return 1;
> +	}

Rather than skipping the bitmap check entirely when FLEX_BG is enabled,
it is probably better to just validate whether each of the bitmap/itable
offsets are within the bitmap being read, like:

	offset = ...
	if (offset < EXT4_BLOCKS_PER_GROUP(sb) &&
	    ext4_test_bit(offset, bh->b_data))
		/* bad block bitmap */
	    	goto err_out;

Cheers, Andreas
--
Andreas Dilger
Sr. Software Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

-
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