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]
Message-ID: <CAJSVwFNFr-1908AYmMKzHirub6x+ZcSkA5v8GfSY4T1rsbO4Ag@mail.gmail.com>
Date:	Fri, 7 Dec 2012 20:13:59 +0800
From:	Forrest Liu <forrestl@...ology.com>
To:	Ashish Sangwan <ashishsangwan2@...il.com>
Cc:	"Theodore Ts'o" <tytso@....edu>,
	ext4 development <linux-ext4@...r.kernel.org>,
	Eric Sandeen <sandeen@...hat.com>
Subject: Re: [PATCH] ext4: fix extent tree corruption that incurred by hole punch

2012/12/7 Ashish Sangwan <ashishsangwan2@...il.com>:
> On Thu, Dec 6, 2012 at 8:06 PM, Forrest Liu <forrestl@...ology.com> wrote:
>> Hi Ashish,
>>
>>    There have a chance to do  a trivial update, and this case will be
>> covered in ext4_ext_remove_space.
>>
>> +       if (err == 0 && eh->eh_entries == 0 && path[depth].p_bh != NULL) {
>>                  err = ext4_ext_rm_idx(handle, inode, path + depth);
>> +               /* If this was the first extent index in node,
>> +                * propagates the ei_block updation info to top */
>> +               if(!err) {
>> +                       --depth;
>> +                       path = path + depth;
>> +                       while (--depth >= 0) {
>> +                               if (path->p_idx != EXT_FIRST_INDEX(path->p_hdr))
>> +                                       break;
>> +                               path--;
>> +                               err = ext4_ext_get_access(handle, inode, path);
>> +                               if (err)
>> +                                       break;
>>
>>         trivial update, when (path + 1)->p_idx->eh_entries == 0
>>
>> +                               path->p_idx->ei_block =(path +
>> 1)->p_idx->ei_block ;
>> +                               err = ext4_ext_dirty(handle, inode, path);
>> +                               if (err)
>> +                                       break;
>> +                       }
>> +               }
>> +       }
>> +
>>
>>    I will trying to reproduce the problem tomorrow.
> I think it will  work fine atleast till depth = 2.
> It would be great if you could check with depth > 2.
> If still having this problem, we can think more.

Hi Ashish,

First, create a file lager than 4GB, and then punch out every even blocks;
Use ex command in debugfs to dump extents, belowing is the result.

Level Entries           Logical              Physical Length Flags
 0/ 3   1/  1       1 - 1048575     40013             1048575
 1/ 3   1/  5       1 -  231160     40012             231160
 2/ 3   1/340       1 -     680     40011                680
 3/ 3   1/340       1 -       1   2228225 -   2228225      1
 3/ 3   2/340       3 -       3   2228227 -   2228227      1
 3/ 3   3/340       5 -       5   2228229 -   2228229      1


punch out 231159, 231157, ..., 1..


Level Entries           Logical              Physical Length Flags
 0/ 3   1/  1       1 - 1048575     40013             1048575
 1/ 3   1/  4  231161 -  462320   2457604             231160
 2/ 3   1/340  231161 -  231840   2457606                680
 3/ 3   1/340  231161 -  231161   2459385 -   2459385      1


Then, we get incorrect logical index, if only do correction in ext4_ext_rm_leaf.


Thanks,
Forrest
--
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