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:	Mon, 20 Feb 2012 15:56:28 -0500
From:	Phillip Susi <psusi@...ntu.com>
To:	Lukas Czerner <lczerner@...hat.com>
CC:	linux-ext4@...r.kernel.org
Subject: e2fsck discard errors

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I was experimenting with e2fsck -E discard on image files and found
some errors introduced by commit efa1a355.  The following section of
code attempts to discard unused portions of the inode table:


/* Discard inode table */
if (ctx->options & E2F_OPT_DISCARD) {
        blk64_t used_blks, blk, num;

        used_blks = DIV_ROUND_UP(
                (EXT2_INODES_PER_GROUP(fs->super) -
                 group_free),
                EXT2_INODES_PER_BLOCK(fs->super));

        blk = ext2fs_inode_table_loc(fs, group) +
                used_blks;
        num = fs->inode_blocks_per_group -
                used_blks;
        e2fsck_discard_blocks(ctx, manager, blk, num);
}

There are two problems with this.  The first is that trying to discard
a count of zero blocks results in an -EINVAL, which silently halts (
shouldn't this at least issue a warning? ) further discard attempts.
The second I noticed after fixing that problem and had a bunch of
valid inodes discarded.  It looks like the intent of this code is to
free the part of the inode table that lies beyond the highest used
inode, but instead it is using the count of free inodes, so when you
have some free inodes followed by some used inodes, the used inodes at
the end get discarded.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPQrN8AAoJEJrBOlT6nu75X+cH/RkJeOCGM574YabLu081oGC1
d59Y9Q3gD0jswTtceFFLHWQkRsI6IiRznEp6h+IMixl7VARL6q8eoFWW0iIWqjkX
mCle03+fORxXOv2U4qg3bud5gZ4jDKW7cKZvKl+LbOFFuV11W8UKdmgDqL0HyUxh
bIC5lyUCHEWSm6/ellfSRJDFLL0ygw2irktjyszIgAGPfnbtH/fu3E0se98ke9P5
5j8jQSeONJA5VDOtVnsLR3TD9SnnhBrtbjkzSbqBDMBSy+/ji0208CY5UyrxX0y8
Oh3pWsi6GAgAKdQgVdv/acRTirOkXLMLMK0SuoUuxIlzmrAIolWI2CO8DinwZ3U=
=8H+8
-----END PGP SIGNATURE-----
--
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