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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070102094727.GA5932@amitarora.in.ibm.com>
Date:	Tue, 2 Jan 2007 15:17:27 +0530
From:	"Amit K. Arora" <aarora@...ux.vnet.ibm.com>
To:	Alex Tomas <alex@...sterfs.com>
Cc:	linux-ext4@...r.kernel.org, suparna@...ibm.com, cmm@...ibm.com
Subject: Re: [PATCH 1/1] Extent overlap bugfix in ext4

On Tue, Jan 02, 2007 at 12:25:21PM +0300, Alex Tomas (AT) wrote:
> >>>>> Amit K Arora (AKA) writes:
> 
>  AKA> The ext4_ext_get_blocks() and ext4_ext_insert_extent() routines do not
>  AKA> check for extent overlap, when a new extent needs to be inserted in an
>  AKA> inode. An overlap is possible when the new extent being inserted has
>  AKA> ee_block that is not part of any of the existing extents, but the
>  AKA> tail/center portion of this new extent _is_. This is possible only when
>  AKA> we are writing/preallocating blocks across a hole.
> 
> AT> not sure I understand ... you shouldn't insert an extent that overlap
> AT> any existing extent. when you write block(s), you first check is
> AT> it already allocated and insert new extent only if it's not.

You are right. That is what this patch does.
The current ext4 code is inserting an overlapped extent in a particular
scenario (explained above). The suggested patch fixes this by having a
check in get_blocks() for _not_ inserting an extent that may overlap
with an existing one.

> AT> for preallocated block(s), you should adapt existing extent(s) so that
> AT> they don't overlap new extent you're inserting. am I missing something?

The patch makes the new extent being inserted adjust its length based on any
existing extent that may overlap, so that the overlap does not happen at
all.

> AT> also, I think that modification of existing extent(s) (not merging)
> AT> isn't safe.

The existing extent(s) are not being modified in any way here. We check
if there is an overlap between the new extent being inserted by
get_blocks(), with an existing one. If there is, we update the new extent
(being inserted) accordingly. The existing extent is not touched (unless
the insert_extent() does a merge, if possible).

Please let me know if the intentions are still not clear here. Thanks!

Regards,
Amit Arora
-
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