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] [day] [month] [year] [list]
Date:   Tue, 23 May 2017 11:42:06 -0700
From:   "Darrick J. Wong" <darrick.wong@...cle.com>
To:     Marc Thomas <marc@...gonfly.plus.com>
Cc:     linux-ext4@...r.kernel.org, "Theodore Ts'o" <tytso@....edu>
Subject: Re: e2fsck bug? - Sparse files corrupt after "e2fsck -E bmap2extent".

On Tue, May 23, 2017 at 06:41:48PM +0100, Marc Thomas wrote:
> Hi Ted,
> 
> Firstly, thank-you for taking the time to look into this.
> 
> I have modified your script with a "test-case" which fails for me every
> time, as I noticed there is a file created by a Linux kernel build which
> exhibits the problem (arch/x86/realmode/rm/realmode.bin) I think any
> kernel version 3.10.x on x86_64 ought to work. I've also included a few
> extra steps which I'm doing as part of the ext3 to ext4 conversion, and
> added the "-b" (binary) flag to md5sum.
> 
> Here's the script. I'm not sure if it counts as a "simple" repro! :)

Aha!  There is a bug in e2fsck's bmap2extent converter that merges bmap
records that are physically but not logically contiguous.  I will
produce a patch + testcase shortly.

--D

> 
> 
> ----- cut here -----
> #!/bin/bash
> 
> rm -f /tmp/foo.img
> mke2fs -t ext3 -Fq /tmp/foo.img 5G
> mount -o loop /tmp/foo.img /mnt
> dd if=/etc/motd of=/mnt/test bs=4k >& /dev/null
> dd if=/etc/motd of=/mnt/test conv=notrunc seek=32 bs=4k >& /dev/null
> dd if=/etc/motd of=/mnt/test2 bs=4k >& /dev/null
> dd if=/etc/motd of=/mnt/test2 conv=notrunc seek=1024 bs=4k >& /dev/null
> md5sum -b /mnt/test* > /mnt/MD5SUMS
> lsattr /mnt/test*
> ( cd /mnt
> xz -dc ~marc/LinuxStuff/Linux4.x/linux-4.11.1.tar.xz | tar xvf -
> cd linux-4.11.1
> make defconfig
> time make -j 15 ) > /dev/null 2>&1
> md5sum -b /mnt/linux-4.11.1/arch/x86/realmode/rm/realmode.bin >>
> /mnt/MD5SUMS
> lsattr /mnt/linux-4.11.1/arch/x86/realmode/rm/realmode.bin
> umount /mnt
> tune2fs -O extents,uninit_bg,dir_index /tmp/foo.img
> e2fsck -fy /tmp/foo.img
> e2fsck -fy -E bmap2extent /tmp/foo.img
> mount -o loop /tmp/foo.img /mnt
> md5sum -c /mnt/MD5SUMS
> lsattr /mnt/test*
> lsattr /mnt/linux-4.11.1/arch/x86/realmode/rm/realmode.bin
> umount /mnt
> ----- cut here -----
> 
> 
> The output of the script is:
> 
> time ./marc2.sh
> ------------------- /mnt/test
> ------------------- /mnt/test2
> ------------------- /mnt/linux-4.11.1/arch/x86/realmode/rm/realmode.bin
> tune2fs 1.43.4 (31-Jan-2017)
> e2fsck 1.43.4 (31-Jan-2017)
> Pass 1: Checking inodes, blocks, and sizes
> Pass 2: Checking directory structure
> Pass 3: Checking directory connectivity
> Pass 4: Checking reference counts
> Pass 5: Checking group summary information
> /tmp/foo.img: 71184/327680 files (6.4% non-contiguous), 338237/1310720
> blocks
> e2fsck 1.43.4 (31-Jan-2017)
> Pass 1: Checking inodes, blocks, and sizes
> Pass 1E: Optimizing extent trees
> Pass 2: Checking directory structure
> Pass 3: Checking directory connectivity
> Pass 4: Checking reference counts
> Pass 5: Checking group summary information
> 
> /tmp/foo.img: ***** FILE SYSTEM WAS MODIFIED *****
> /tmp/foo.img: 71184/327680 files (6.4% non-contiguous), 334994/1310720
> blocks
> /mnt/test: OK
> /mnt/test2: OK
> /mnt/linux-4.11.1/arch/x86/realmode/rm/realmode.bin: FAILED
> md5sum: WARNING: 1 computed checksum did NOT match
> --------------e---- /mnt/test
> --------------e---- /mnt/test2
> --------------e---- /mnt/linux-4.11.1/arch/x86/realmode/rm/realmode.bin
> 
> real    1m46.829s
> user    17m41.611s
> sys     1m39.268s
> 
> Thanks & Kind Regards,
> Marc
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ