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] [day] [month] [year] [list]
Date:	Thu, 17 Jul 2008 08:47:51 -0500
From:	"Jose R. Santos" <jrs@...ibm.com>
To:	Frédéric Bohé <frederic.bohe@...l.net>
Cc:	linux-ext4 <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH][e2fsprogs] Fix inode table allocation with flexbg

On Thu, 17 Jul 2008 13:34:41 +0200
Frédéric Bohé <frederic.bohe@...l.net> wrote:

> From: Frederic Bohe <frederic.bohe@...l.net>
> 
> Disordered inode tables may appear when inode_blocks_per_group is lesser
> or equal to the number of groups in a flex group.
> 

Acked-by: Jose R. Santos <jrs@...ibm.com>    with some comments bellow 

> Signed-off-by: Frederic Bohe <frederic.bohe@...l.net>
> ---
> This bug can be reproduced with:
>  mkfs.ext4 -t ext4dev -G512 70G
> 
> In that case, you can see with dump2fs that inode tables for groups 510
> and 511 are placed just after group 51's inode table instead of being 
> placed after group 509's inode table.
> 
>  alloc_tables.c |   16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)
> 
> Index: e2fsprogs/lib/ext2fs/alloc_tables.c
> ===================================================================
> --- e2fsprogs.orig/lib/ext2fs/alloc_tables.c	2008-07-17 10:33:56.000000000 +0200
> +++ e2fsprogs/lib/ext2fs/alloc_tables.c	2008-07-17 10:46:49.000000000 +0200
> @@ -34,9 +34,10 @@
>   * tables can be allocated continously and in order.
>   */
>  static blk_t flexbg_offset(ext2_filsys fs, dgrp_t group, blk_t start_blk,
> -			   ext2fs_block_bitmap bmap, int offset, int size)
> +			   ext2fs_block_bitmap bmap, int offset, int size,
> +			   int elem_size)

While there is nothing technically wrong with the patch I think it
exposes an issue with the original flexbg_offset function.  The routine
right now requires to many arguments and you need to do some
calculations within some of the arguments which make this look ugly
and error prone if someone decides to modify this code later on.

I've been thinking about rewriting this function so it looks something
like this:

static blk64_t flexbg_offset(ext2_filsys fs, ext2fs_block_bitmap bmap, 
				dgrp_t group, unsigned int type)

and do all the offset, start_blk, size, elem_size calculations inside
the routine.  I need to make a long term fix for this issue since I
think 7 args for this routine is just to much.

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