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]
Date:	Wed, 17 Jan 2007 15:23:31 -0700
From:	Andreas Dilger <adilger@...sterfs.com>
To:	Alex Tomas <alex@...sterfs.com>
Cc:	linux-ext4@...r.kernel.org
Subject: Re: [PATCH] more sanity check in extents

On Jan 12, 2007  03:18 +0300, Alex Tomas wrote:
> +/*
> + * the routine checks that every block start with key value specified
> + * in the pointed at the upper layer
> + */
> +static int __ext4_ext_check_interlevel(const char *function, struct inode *inode,
> +					struct ext4_ext_path *path, int depth)
> +{
> +	unsigned long key, first;
> +
> +	if (ext_depth(inode) == 0)
> +		return 0;
> +
> +	/* nothing to check at the top */
> +	if (depth == ext_depth(inode))
> +		return 0;
> +
> +	/* after split, a leaf can get zero entries
> +	 * thus there is nothing to check */
> +	if (le16_to_cpu(path->p_hdr->eh_entries) == 0)
> +		return 0;
> +
> +	if (depth == 0)
> +		first = le32_to_cpu(EXT_FIRST_EXTENT(path->p_hdr)->ee_block);
> +	else
> +		first = le32_to_cpu(EXT_FIRST_INDEX(path->p_hdr)->ei_block);
> +	path--;
> +	key = le32_to_cpu(path->p_idx->ei_block);
> +	
> +	if (likely(first == key))
> +		return 0;

What happens if, say, a leaf is split and then the first part of the split
is removed?  This could only happen with punch() on a running filesystem,
but in e2fsck a corrupt extent will be removed from the leaf without
updating the parent index's range.

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, 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