linux/fs/hfsplus
Eric Sandeen 9250f92597 hfsplus: handle more on-disk corruptions without oopsing
hfs seems prone to bad things when it encounters on disk corruption.  Many
values are read from disk, and used as lengths to memcpy, as an example.
This patch fixes up several of these problematic cases.

o sanity check the on-disk maximum key lengths on mount
  (these are set to a defined value at mkfs time and shouldn't differ)
o check on-disk node keylens against the maximum key length for each tree
o fix hfs_btree_open so that going out via free_tree: doesn't wind
  up in hfs_releasepage, which wants to follow the very pointer
  we were trying to set up:
	HFS_SB(sb)->cat_tree = hfs_btree_open()
    .
  failure gets to hfs_releasepage and tries to follow HFS_SB(sb)->cat_tree

Tested with the fsfuzzer; it survives more than it used to.

[hch: ported of commit cf05946250 from hfs]
[hch: added the fixes from 5581d018ed3493d226e7a4d645d9c8a5af6c36b]

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Christoph Hellwig <hch@tuxera.com>
2010-10-14 09:53:48 -04:00
..
bfind.c hfsplus: handle more on-disk corruptions without oopsing 2010-10-14 09:53:48 -04:00
bitmap.c hfsplus: fix HFSPLUS_SB calling convention 2010-10-01 05:42:59 +02:00
bnode.c [PATCH] fs: Conversions from kmalloc+memset to k(z|c)alloc 2006-09-27 08:26:10 -07:00
brec.c hfsplus: handle more on-disk corruptions without oopsing 2010-10-14 09:53:48 -04:00
btree.c hfsplus: handle more on-disk corruptions without oopsing 2010-10-14 09:53:48 -04:00
catalog.c hfsplus: fix HFSPLUS_I calling convention 2010-10-01 05:43:31 +02:00
dir.c hfsplus: fix rename over directories 2010-10-01 09:12:08 +02:00
extents.c hfsplus: add missing extent locking in hfsplus_write_inode 2010-10-01 05:46:31 +02:00
hfsplus_fs.h hfsplus: convert tree_lock to mutex 2010-10-01 05:46:52 +02:00
hfsplus_raw.h hfsplus: handle more on-disk corruptions without oopsing 2010-10-14 09:53:48 -04:00
inode.c hfsplus: remove the rsrc_inodes list 2010-10-01 05:44:02 +02:00
ioctl.c hfsplus: fix HFSPLUS_I calling convention 2010-10-01 05:43:31 +02:00
Kconfig fs/Kconfig: move hfs, hfsplus out 2009-01-22 13:15:57 +03:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
options.c hfsplus: use atomic bitops for the superblock flags 2010-10-01 05:45:20 +02:00
part_tbl.c hfsplus: fix HFSPLUS_SB calling convention 2010-10-01 05:42:59 +02:00
super.c hfsplus: use atomic bitops for the superblock flags 2010-10-01 05:45:20 +02:00
tables.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
unicode.c hfsplus: use atomic bitops for the superblock flags 2010-10-01 05:45:20 +02:00
wrapper.c hfsplus: use atomic bitops for the superblock flags 2010-10-01 05:45:20 +02:00