]> bbs.cooldavid.org Git - net-next-2.6.git/commit
ext4: avoid uninitialized memory references in ext3_htree_next_block()
authorTheodore Ts'o <tytso@mit.edu>
Thu, 28 Oct 2010 01:30:08 +0000 (21:30 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 28 Oct 2010 01:30:08 +0000 (21:30 -0400)
commit8941ec8bb6443d28d5c25311870aeaa809cf1538
tree5fbd2aff55ff077ec98604b03f6fc9d35a6f081d
parent640e9396566a1e1f52f2db294755a23f1e62cc97
ext4: avoid uninitialized memory references in ext3_htree_next_block()

If the first block of htree directory is missing '.' or '..' but is
otherwise a valid directory, and we do a lookup for '.' or '..', it's
possible to dereference an uninitialized memory pointer in
ext4_htree_next_block().

We avoid this by moving the special case from ext4_dx_find_entry() to
ext4_find_entry(); this also means we can optimize ext4_find_entry()
slightly when NFS looks up "..".

Thanks to Brad Spengler for pointing a Clang warning that led me to
look more closely at this code.  The warning was harmless, but it was
useful in pointing out code that was too ugly to live.  This warning was
also reported by Roman Borisov.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Brad Spengler <spender@grsecurity.net>
fs/ext4/namei.c