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]
Date:   Tue, 26 Jun 2018 18:44:24 +0200
From:   Lukas Czerner <lczerner@...hat.com>
To:     linux-ext4@...r.kernel.org
Subject: e2fsprogs: f_eofblocks and f_pgsize_gt_blksize fails on 1.44.3-rc1

Hi all,

I've noticed that f_eofblocks fails on systems with page size > 4k
(like ppc46) due to this commit.

commit 8d541f641ef3861276f7138b2f3e601036f03110
Author: Andreas Dilger <andreas.dilger@...el.com>
Date:   Sat Jun 23 14:30:52 2018 -0400

    e2fsck: handle preallocation for large PAGE_SIZE
    
    Fix handling of block preallocation support in cases where the kernel
    PAGE_SIZE is larger than the filesystem blocksize.

Test f_pgsize_gt_blksize was added right after this commit and it also fails
on ppc64

I belive that the reason is this

		if ((pb.last_init_lblock >= 0) &&
		    /* if size is smaller than expected by the block count,
		     * allow allocated blocks to end of PAGE_SIZE.
		     * last_init_lblock is the last in-use block, so it is
		     * the minimum expected file size, but +1 because it is
		     * the base-zero block number and not the block count. */
		    (size < (__u64)pb.last_init_lblock * fs->blocksize) &&
>>>>		    ((pb.last_init_lblock + 1) / blkpg * blkpg !=
>>>>		     (pb.last_init_lblock + 1) ||
		     size < (__u64)(pb.last_init_lblock & ~(blkpg - 1)) *
		     fs->blocksize))
			bad_size = 3;

while the fix seems correct in context I do not understand the point
of the check.  Seems like the reason for it is to make sure that if we do
have any initialized blocks after i_size, it's always up the the page size
boundary.

This was added with commit

commit 9f0288d3bbbf47bb05e5abf1e570df368476a8cd
Author: Theodore Ts'o <tytso@....edu>
Date:   Fri Aug 3 20:43:37 2007 -0400

    e2fsck: Allow i_size to be rounded up to the size of a VM page

    Allow files to be preallocated on-disk up to the next multiple of the
    system's page size without complaining about extra blocks.


It's not explained why we need this. Do we ever want to allow initialized
extents (blocks) past i_size ? I though we do not, what am I missing ?
Shouldn't we only be doing this ?

	if ((pb.last_block >= 0) &&
	    (size < (__u64) pb.last_block * fs->blocksize))
		bad_size = 3;


Thanks!
-Lukas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ