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-next>] [day] [month] [year] [list]
Message-ID: <4D9724AC.2070009@draigBrady.com>
Date:	Sat, 02 Apr 2011 14:29:16 +0100
From:	Pádraig Brady <P@...igBrady.com>
To:	8411@...bugs.gnu.org
CC:	linux-ext4@...r.kernel.org
Subject: Re: bug#8411: due to missing sync even on 2.6.39,	cp fails to copy
 an odd file

On 02/04/11 12:16, Jim Meyering wrote:
> Hi Pádraig,
> 
> As of this change,
> 
>     copy: with fiemap copy, only sync when needed
>     http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=f69876e55
> 
> fiemap copy with extents beyond EOF can fail on ext4 even with
> Fedora 15 (2.6.38) and rawhide's 2.6.39 kernel.
> 
> Here we construct an odd file.  First, preallocate 10MB of space,
> and then write 5KiB of random data into the beginning of that:
> 
>     $ fallocate -l 10000000 -n k
>     $ dd count=10 if=/dev/urandom conv=notrunc iflag=fullblock of=k
> 
> However, when we try to copy "k", we get a file, "k2" of the
> expected size, but with only NUL bytes for contents:

So the extent info is not updated until sync(),
which means cp will consider the "unwritten" extent
as NUL data and not bother to read it :(

I guess this is a corner case that was missed
in the fixups for ext4 (and btrfs?) in 2.6.38 for this?
I've copied ext4 devs for clarification.
I.E. if you do this:

  fallocate -l 10000000 -n k
  dd count=10 if=/dev/urandom conv=notrunc iflag=fullblock of=k
  filefrag -v k

Do you get all extents still unwritten.
I do on my 2.6.35.11-83.fc14.i686 kernel, but I expected that.

cheers,
Pádraig.
--
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