linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sami Liedes <sami.liedes@iki.fi>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: Valgrind-detected issues in e2fsck on corrupted filesystems
Date: Sun, 26 Oct 2014 12:47:09 +0200	[thread overview]
Message-ID: <20141026104708.GA31873@sli.dy.fi> (raw)
In-Reply-To: <20141020205736.GB13081@birch.djwong.org>

[-- Attachment #1: Type: text/plain, Size: 3878 bytes --]

On Mon, Oct 20, 2014 at 01:57:36PM -0700, Darrick J. Wong wrote:
> Thanks for catching these!  I'll have patches out shortly.

Great! With your patches applied I could no longer get any valgrind
errors on ext4 during overnight fuzz testing.

Here's one more I found which only shows on ext[23], with or without
your recent patches. It seems that the error message "Unexpected block
in HTREE directory inode %d (%q)" is printed with uninitialized values
for both the %d and the %q conversions.

Pristine: http://www.niksula.hut.fi/~sliedes/e2fsck/testimg.ext2.bz2
Fuzzed: http://www.niksula.hut.fi/~sliedes/e2fsck/testimg.ext2.78.min.bz2

1-bit diff:

--- /dev/fd/63  2014-10-26 12:33:05.879722761 +0200
+++ /dev/fd/62  2014-10-26 12:33:05.880722761 +0200
@@ -9032,6 +9032,9 @@
 0013fc10  0a 05 00 00 0b 05 00 00  2b 05 00 00 00 00 00 00  |........+.......|
 0013fc20  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
+0013fcb0  00 00 00 00 00 00 00 00  00 00 04 00 00 00 00 00  |................|
+0013fcc0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+*
 00140000  34 02 00 00 30 00 26 07  5c 78 32 66 64 65 76 69  |4...0.&.\x2fdevi|
 00140010  63 65 73 5c 78 32 66 76  69 72 74 75 61 6c 5c 78  |ces\x2fvirtual\x|
 00140020  32 66 74 74 79 5c 78 32  66 74 74 79 35 33 00 00  |2ftty\x2ftty53..|

Output:

------------------------------------------------------------
e2fsck 1.43-WIP (29-Aug-2014)
Pass 1: Checking inodes, blocks, and sizes
Inode 426 has illegal block(s).  Clear? yes

Illegal block #58 (262144) in inode 426.  CLEARED.
Pass 2: Checking directory structure
Directory inode 426 has an unallocated block #19.  Allocate? yes

Unexpected block in HTREE directory inode ==17310== Use of uninitialised value of size 8
==17310==    at 0x529C0FB: _itoa_word (_itoa.c:179)
==17310==    by 0x529FB02: vfprintf (vfprintf.c:1635)
==17310==    by 0x52A1340: buffered_vfprintf (vfprintf.c:2312)
==17310==    by 0x529C3DD: vfprintf (vfprintf.c:1290)
==17310==    by 0x52A6526: fprintf (fprintf.c:32)
==17310==    by 0x4333BB: expand_percent_expression (message.c:451)
==17310==    by 0x433817: print_e2fsck_message (message.c:552)
==17310==    by 0x4325D1: fix_problem (problem.c:2130)
==17310==    by 0x424A8B: check_dir_block (pass2.c:973)
==17310==    by 0x44AF96: ext2fs_dblist_iterate2 (dblist.c:211)
==17310==    by 0x422E34: e2fsck_pass2 (pass2.c:149)
==17310==    by 0x4149DF: e2fsck_run (e2fsck.c:230)
[...]
87815056 (==17310== Conditional jump or move depends on uninitialised value(s)
==17310==    at 0x432977: print_pathname (message.c:203)
==17310==    by 0x4334FE: expand_percent_expression (message.c:480)
==17310==    by 0x433817: print_e2fsck_message (message.c:552)
==17310==    by 0x4325D1: fix_problem (problem.c:2130)
==17310==    by 0x424A8B: check_dir_block (pass2.c:973)
==17310==    by 0x44AF96: ext2fs_dblist_iterate2 (dblist.c:211)
==17310==    by 0x422E34: e2fsck_pass2 (pass2.c:149)
==17310==    by 0x4149DF: e2fsck_run (e2fsck.c:230)
==17310==    by 0x4139E6: main (unix.c:1649)
==17310== 
==17310== Conditional jump or move depends on uninitialised value(s)
==17310==    at 0x456D29: ext2fs_get_pathname (get_pathname.c:165)
==17310==    by 0x4329C2: print_pathname (message.c:209)
==17310==    by 0x4334FE: expand_percent_expression (message.c:480)
==17310==    by 0x433817: print_e2fsck_message (message.c:552)
==17310==    by 0x4325D1: fix_problem (problem.c:2130)
==17310==    by 0x424A8B: check_dir_block (pass2.c:973)
==17310==    by 0x44AF96: ext2fs_dblist_iterate2 (dblist.c:211)
==17310==    by 0x422E34: e2fsck_pass2 (pass2.c:149)
==17310==    by 0x4149DF: e2fsck_run (e2fsck.c:230)
==17310==    by 0x4139E6: main (unix.c:1649)
[...]
???).
------------------------------------------------------------

	Sami

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-10-26 10:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-18 23:23 Valgrind-detected issues in e2fsck on corrupted filesystems Sami Liedes
2014-10-20 20:57 ` Darrick J. Wong
2014-10-26 10:47   ` Sami Liedes [this message]
2014-10-27 17:10     ` Darrick J. Wong
2014-10-27 22:10       ` Sami Liedes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141026104708.GA31873@sli.dy.fi \
    --to=sami.liedes@iki.fi \
    --cc=darrick.wong@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).