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  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 21 Apr 2011 20:27:25 +0200
From:	Jim Meyering <>
To:	ext <>
Subject: ext4: 1k-blocksize loopback corruption without removing backing file

Much like this report,

    loopback-mounted ext4 sees hole-filling (on rawhide, but not F15)

but not requiring that one remove the backing file, this script shows the
same sort of corruption with a loopback-ext4-in-loopback-ext4 file system:
[Note these FS are small enough that they get a blocksize of 1024 by default.
 When I specify -b 2048 or 4096, the problem goes away. ]

set -e
dd if=/dev/zero of=blob bs=9k count=1000 >/dev/null 2>&1
mkdir mnt
mkfs -q -t ext4 -F blob
mount -oloop blob mnt

cd mnt

dd if=/dev/zero of=blob bs=4k count=1000 >/dev/null 2>&1
mkdir m2
mkfs -q -t ext4 -F blob
mount -oloop blob m2

cd m2

# Create a reference file.  Just like the following one,
# but with explicit NULs in place of holes.
perl -e '$n=1024; for (1..71) { print "\0"x$n, chr($_)x$n };' \
  -e 'close *STDOUT or die "$!"' > ref

# Seek 1KB, write 1KB of data, seek 1KB, write 1KB of data, etc....
perl -e '$n = 1 * 1024; *F = *STDOUT;' \
  -e 'for (1..71) { sysseek (*F, $n, 1)' \
  -e '&& syswrite (*F, chr($_)x$n) or die "$!"}' > j1

# filefrag -vs j1

cmp -s ref j1 && fail=0 || fail=1

cd /
umount "$c2/m2" "$c1/mnt"
rm -rf "$c1/blob" "$c1/mnt"

exit $fail

This shows that it fails most of the time for me in tmpfs on a rawhide
guest (2.6.39-0.rc3.git2.0.fc16.x86_64) running on an F15 host.  YMWV.

    $ while :; do ./ext4-bug; printf $?; done
    [Exit 130 (INT)]
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists