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: <FDC91B229D965C458E3615E98C48ADDD0EC4179B@dggemm511-mbx.china.huawei.com>
Date:   Fri, 29 Jun 2018 02:06:03 +0000
From:   "Gaoming (ming, consumer BG)" <gaoming20@...wei.com>
To:     "Theodore Y. Ts'o" <tytso@....edu>
CC:     "linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "Liqingchao (sorp)" <sorp.liqingchao@...wei.com>,
        "Shenchen (harry)" <harry.shen@...wei.com>,
        "miaoxie (A)" <miaoxie@...wei.com>,
        "yangfei (D)" <yangfei39@...wei.com>,
        "Renlipeng (OS driver)" <renlipeng@...wei.com>
Subject: 答复: 答复: 答复: [PATCH] ext4: e2fsprogs: fix inode bitmap num not integer,incompatible for ancient android devices

We use usual inode size, it is 256 bytes.

Yes, this commit is in my repository.
But there is a bug in this patch.

Let me show you,
Here is the bug: " return ALIGN(inodes, (info.block_size / info.inode_size));"

In my reproduce,
info.block_size = 1024, (it is legal)
info.inode_size =256,

the code only ALIGN BY 4.

But in real scenario, we should align by 8,( 8 bit per bytes in inode map).

So we got Inodes per group: 1708 , which is illegal.

Like below,

./host/linux-x86/bin/make_ext4fs  -s -l 20M -b 1024 gaoming.img 
Creating filesystem with parameters:
    Size: 20971520
    Block size: 1024
    Blocks per group: 8192
    Inodes per group: 1708
    Inode size: 256
    Journal blocks: 1024
    Label:
    Blocks: 20480
    Block groups: 3
    Reserved block group size: 95
Created filesystem with 11/5124 inodes and 2509/20480 blocks

This bug exists very very long time till now.


Regards,
Ming

-----邮件原件-----
发件人: Theodore Y. Ts'o [mailto:tytso@....edu] 
发送时间: 2018年6月28日 23:30
收件人: Gaoming (ming, consumer BG)
抄送: linux-ext4@...r.kernel.org; linux-kernel@...r.kernel.org; Liqingchao (sorp); Shenchen (harry); miaoxie (A); yangfei (D); Renlipeng (OS driver)
主题: Re: 答复: 答复: [PATCH] ext4: e2fsprogs: fix inode bitmap num not integer,incompatible for ancient android devices

On Thu, Jun 28, 2018 at 07:56:59AM +0000, Gaoming (ming, consumer BG) wrote:
> You see, Inodes per group is 1708,which is illegal as you said.
> 
> So, the problem exists a long time until Jun 21th 2018.
> 
> You complained the problem in 2011, they do not fix it till 2018.
> Just as
> I complained, fix it,  and you do not accept it. ^_^

Here's the commit.  (Note the date.)   Do you see it in your repository?

Or are you using an unusual inode size?  (e.g., not 256 bytes, or 16
inodes per block).


       	   	       	       	     	  - Ted

commit 06c35f935a7adadceb9ee326b3231f952f6ad203
Merge: 480a3b1 96cc54a
Author: Colin Cross <ccross@...roid.com>
Date:   Sat Apr 30 19:08:09 2011 -0700

    Merge "Make inodes per group a multiple of inodes per block"

diff --cc ext4_utils/make_ext4fs.c
index c9fd992,e37d617..22c9424
--- a/ext4_utils/make_ext4fs.c
+++ b/ext4_utils/make_ext4fs.c
@@@ -214,26 -215,10 +214,27 @@@ static u32 compute_inodes_per_group(
  {
  	u32 blocks = DIV_ROUND_UP(info.len, info.block_size);
  	u32 block_groups = DIV_ROUND_UP(blocks, info.blocks_per_group);
- 	return DIV_ROUND_UP(info.inodes, block_groups);
+ 	u32 inodes = DIV_ROUND_UP(info.inodes, block_groups);
+ 	return ALIGN(inodes, (info.block_size / info.inode_size));
  }
  
 +static u32 compute_bg_desc_reserve_blocks()
 +{
 +	u32 blocks = DIV_ROUND_UP(info.len, info.block_size);
 +	u32 block_groups = DIV_ROUND_UP(blocks, info.blocks_per_group);
 +	u32 bg_desc_blocks = DIV_ROUND_UP(block_groups * sizeof(struct ext2_group_desc),
 +			info.block_size);
 +
 +	u32 bg_desc_reserve_blocks =
 +			DIV_ROUND_UP(block_groups * 1024 * sizeof(struct ext2_group_desc),
 +					info.block_size) - bg_desc_blocks;
 +
 +	if (bg_desc_reserve_blocks > info.block_size / sizeof(u32))
 +		bg_desc_reserve_blocks = info.block_size / sizeof(u32);
 +
 +	return bg_desc_reserve_blocks;
 +}
 +
  void reset_ext4fs_info() {
      // Reset all the global data structures used by make_ext4fs so it
      // can be called again.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ