diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2008-05-12 17:02:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-13 11:02:24 -0400 |
commit | 706322496b3a58af3cf258db2b553d6933656eef (patch) | |
tree | ec64bbc9e20be4a5b2baf9dcbb3e2201e822c97f /fs | |
parent | 4413a0f637df4e59b934909ac388a21cfdd90e69 (diff) |
Fix hfsplus oops on image without extents
Fix an oops with a corrupted hfs+ image.
See http://bugzilla.kernel.org/show_bug.cgi?id=10548 for details.
Problem is that we call hfs_btree_open() from hfsplus_fill_super() to set
HFSPLUS_SB(sb).[ext_tree|cat_tree] Both trees are still NULL at this moment.
If hfs_btree_open() fails for any reason it calls iput() on the page, which
gets to hfsplus_releasepage() which tries to access HFSPLUS_SB(sb).* which is
still NULL and oopses while dereferencing it.
[akpm@linux-foundation.org: build fix]
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/hfsplus/inode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index d53b2af91c25..67e1c8b467c4 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c | |||
@@ -65,6 +65,8 @@ static int hfsplus_releasepage(struct page *page, gfp_t mask) | |||
65 | BUG(); | 65 | BUG(); |
66 | return 0; | 66 | return 0; |
67 | } | 67 | } |
68 | if (!tree) | ||
69 | return 0; | ||
68 | if (tree->node_size >= PAGE_CACHE_SIZE) { | 70 | if (tree->node_size >= PAGE_CACHE_SIZE) { |
69 | nidx = page->index >> (tree->node_size_shift - PAGE_CACHE_SHIFT); | 71 | nidx = page->index >> (tree->node_size_shift - PAGE_CACHE_SHIFT); |
70 | spin_lock(&tree->hash_lock); | 72 | spin_lock(&tree->hash_lock); |