linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/24] e2fsprogs patchbomb 7/14, part 1
@ 2014-07-18 22:52 Darrick J. Wong
  2014-07-18 22:52 ` [PATCH 01/24] e4defrag: backwards-allocated files should be defragmented too Darrick J. Wong
                   ` (23 more replies)
  0 siblings, 24 replies; 56+ messages in thread
From: Darrick J. Wong @ 2014-07-18 22:52 UTC (permalink / raw)
  To: tytso, darrick.wong; +Cc: linux-ext4

Hi all,

Since my last patch submission in May, I've been fuzzing both the
in-kernel ext4 driver, and e2fsck.  The main objective of this work
has been to determine if the kernel is capable of detecting invalid
mutations and returning -EIO without crashing; and whether or not
e2fsck can salvage the filesystem (or at least get it back to a
(self-defined) "clean" state) within a finite number of e2fsck runs.

I have a program "e2fuzz" (in patch 24) that formats and populates an
ext4 filesystem, randomly corrupts some number of metadata block
bytes, mounts the FS, tries to do some simple IO, unmounts, then
repeatedly runs fsck until either it says the FS is clean, we've run
too many times, or the output indicates that no progress is being
made.

The kernel, it turns out, seems to be able to handle problems with
grace.  Luckily, it at least has the privilege of simply shutting down
the filesystem.  e2fsck is not so fortunate -- upon detecting badness,
it has to decide a resolution and make it stick.  This exposed a
number of incorrect fixes, infinite loop opportunities, crashes, and
in a few cases, total filesystem destruction.  Lots of patches, though
I swear I'm _not_ paid by the patch. :)

The 24 patches following this mesage fix various problems in the more
mature parts of libext2fs and e2fsck.  Most (18) apply cleanly against
-maint, but a few of them also happen to touch things that only appear
in -next.  There are of course many more patches in the patch set, but
I'm breaking them up to avoid blasting people all at once.  The second
patchbomb will have about 35 fixes against the new features in the
-next branch.  I'll push it out in a few days, since I'm travelling
for OSCON.  The third patchbomb will be the same pile of "new"
features from May's patch series; there's about 20 or so of those.
They haven't changed since May.

The first patch is the e4defrag fix from a few days ago.  There are
three patches to debugfs that made it much easier to figure out what
was going on in the mutated filesystems.  Everything after that are
miscellaneous fixes that e2fuzz turned up.  There are two that I want
to call out specifically -- patch 10 solves the particular problem
that fsck needs to avoid touching corrupt metadata blocks if they're
cross-linked with critical FS metadata.  Patch 11 problem that hidden
allocations (think extra ETB/map blocks when extending a file) were
coming from the wrong block bitmap.  Patch 23 is unchanged from the
May patch set.

I've tested these e2fsprogs changes against the -next branch as of
7/13.  These days, I use several VMs, each with 32M-1G ramdisks to test
with; the test process is "misc/e2fuzz.sh -B <fuzz> -s <size>", where
fuzz is anything from 2 bytes to "0.1%" of metadata bytes.  In the
past month or so I've run about a million iterations of "-B 2" without
incident, and about 100,000 iterations of "-B 0.1%" without problems.
FS size was 256M and yes, some of the testing was done before the most
recent push to git.kernel.org.

Comments and questions are, as always, welcome.

--D

^ permalink raw reply	[flat|nested] 56+ messages in thread

end of thread, other threads:[~2014-07-25 20:19 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-18 22:52 [PATCH 00/24] e2fsprogs patchbomb 7/14, part 1 Darrick J. Wong
2014-07-18 22:52 ` [PATCH 01/24] e4defrag: backwards-allocated files should be defragmented too Darrick J. Wong
2014-07-21 23:44   ` Akira Fujita
2014-07-22 16:32     ` Theodore Ts'o
2014-07-18 22:52 ` [PATCH 02/24] debugfs: Only print the first 60 bytes from i_block on a fast symlink Darrick J. Wong
2014-07-19 16:49   ` Andreas Dilger
2014-07-22 16:43     ` Theodore Ts'o
2014-07-22 20:39       ` Darrick J. Wong
2014-07-22 20:34     ` Darrick J. Wong
2014-07-18 22:52 ` [PATCH 03/24] debugfs: create idump command to dump an inode in hex Darrick J. Wong
2014-07-22 17:47   ` Theodore Ts'o
2014-07-18 22:52 ` [PATCH 04/24] debugfs: allow bmap to allocate blocks Darrick J. Wong
2014-07-22 17:52   ` Theodore Ts'o
2014-07-18 22:52 ` [PATCH 05/24] e2fsck: report correct inode number in pass1b Darrick J. Wong
2014-07-22 17:47   ` Theodore Ts'o
2014-07-18 22:52 ` [PATCH 06/24] e2fsck: don't offer to recreate the journal if fsck is aborting due to bad block bitmaps Darrick J. Wong
2014-07-22 17:58   ` Theodore Ts'o
2014-07-18 22:53 ` [PATCH 07/24] e2fsck: skip clearing bad extents if bitmaps are unreadable Darrick J. Wong
2014-07-22 17:58   ` Theodore Ts'o
2014-07-18 22:53 ` [PATCH 08/24] e2fsck: fix inode coherency issue when iterating an inode's blocks Darrick J. Wong
2014-07-22 18:58   ` Theodore Ts'o
2014-07-18 22:53 ` [PATCH 09/24] e2fsck: clear i_block if there are too many bad block mappings Darrick J. Wong
2014-07-22 18:59   ` Theodore Ts'o
2014-07-22 22:14     ` Darrick J. Wong
2014-07-22 22:48       ` Theodore Ts'o
2014-07-18 22:53 ` [PATCH 10/24] e2fsck: don't clobber critical metadata during check_blocks Darrick J. Wong
2014-07-25  1:03   ` Theodore Ts'o
2014-07-18 22:53 ` [PATCH 11/24] e2fsck: free ctx->fs, not fs, at the end of fsck Darrick J. Wong
2014-07-25  1:14   ` Theodore Ts'o
2014-07-18 22:53 ` [PATCH 12/24] e2fsck: force all block allocations to use block_found_map Darrick J. Wong
2014-07-25  2:18   ` Theodore Ts'o
2014-07-18 22:53 ` [PATCH 13/24] e2fsck: fix off-by-one bounds check on group number Darrick J. Wong
2014-07-25  2:20   ` Theodore Ts'o
2014-07-18 22:53 ` [PATCH 14/24] libext2fs: fix bounds check of the bitmap test range in get_free_blocks2 Darrick J. Wong
2014-07-25 11:13   ` Theodore Ts'o
2014-07-18 22:54 ` [PATCH 15/24] misc: fix problems with strncat Darrick J. Wong
2014-07-25 11:22   ` Theodore Ts'o
2014-07-18 22:54 ` [PATCH 16/24] e2fsck: don't crash during rehash Darrick J. Wong
2014-07-25 11:22   ` Theodore Ts'o
2014-07-18 22:54 ` [PATCH 17/24] e2fsck: reserve blocks for root/lost+found directory repair Darrick J. Wong
2014-07-25 12:12   ` Theodore Ts'o
2014-07-25 20:19     ` Darrick J. Wong
2014-07-18 22:54 ` [PATCH 18/24] e2fsck: collapse holes in extent-based directories Darrick J. Wong
2014-07-25 12:33   ` Theodore Ts'o
2014-07-18 22:54 ` [PATCH 19/24] e2fsck: always submit logical block 0 of a directory for pass 2 Darrick J. Wong
2014-07-25 12:40   ` Theodore Ts'o
2014-07-18 22:54 ` [PATCH 20/24] e2fsck: pass2 should not process directory blocks that are impossibly large Darrick J. Wong
2014-07-25 12:42   ` Theodore Ts'o
2014-07-18 22:55 ` [PATCH 21/24] e2fsck: clear uninit flag on directory extents Darrick J. Wong
2014-07-25 13:00   ` Theodore Ts'o
2014-07-18 22:55 ` [PATCH 22/24] e2fsck: check return value of ext2fs_extent_fix_parents() Darrick J. Wong
2014-07-25 12:51   ` Theodore Ts'o
2014-07-18 22:55 ` [PATCH 23/24] mke2fs: set error behavior at initialization time Darrick J. Wong
2014-07-25 13:00   ` Theodore Ts'o
2014-07-18 22:55 ` [PATCH 24/24] e2fuzz: Create a tool to fuzz ext* filesystems Darrick J. Wong
2014-07-25 13:16   ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).