Whamcloud - gitweb
e2fsck: don't crash during rehash
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 18 Jul 2014 22:54:15 +0000 (15:54 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 25 Jul 2014 11:21:47 +0000 (07:21 -0400)
commitc23b2cc439a042b1e58eef3eb09668d3f7349600
treed28dff392a83571562e6d6cc933d0434f4bd6807
parentc3470fcd60be3b47f077dbddf6c6e7246903c27b
e2fsck: don't crash during rehash

If a user crafts a carefully constructed filesystem containing a
single directory entry block with an invalid checksum and fewer than
two entries, and then runs e2fsck to fix the filesystem, fsck will
crash when it tries to "compress" the short dir and passes a negative
dirent array length to qsort.  Therefore, don't allow directory
"compression" in this situation.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/rehash.c