android_kernel_motorola_sm6225/fs/adfs
Stuart Swales 2f09719af7 adfs: fix E+/F+ dir size > 2048 crashing kernel
Kernel crashes in fs/adfs module when accessing directories with a large
number of objects on mounted Acorn ADFS E+/F+ format discs (or images) as
the existing code writes off the end of the fixed array of struct
buffer_head pointers.

Additionally, each directory access that didn't crash would leak a buffer
as nr_buffers was not adjusted correctly for E+/F+ discs (was always left
as one less than required).

The patch fixes this by allocating a dynamically-sized set of struct
buffer_head pointers if necessary for the E+/F+ case (many directories
still do in fact fit in 2048 bytes) and sets the correct nr_buffers so
that all buffers are released.

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=26072

Tested by tar'ing the contents of my RISC PC's E+ format 20Gb HDD which
contains a number of large directories that previously crashed the kernel.

Signed-off-by: Stuart Swales <stuart.swales.croftnuisk@gmail.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-03-22 17:44:17 -07:00
..
adfs.h adfs: fix E+/F+ dir size > 2048 crashing kernel 2011-03-22 17:44:17 -07:00
dir.c adfs: remove the big kernel lock 2011-03-02 00:02:38 +01:00
dir_f.c Cleanup of adfs headers 2009-06-17 00:36:36 -04:00
dir_f.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
dir_fplus.c adfs: fix E+/F+ dir size > 2048 crashing kernel 2011-03-22 17:44:17 -07:00
dir_fplus.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
file.c rename the generic fsync implementations 2010-05-27 22:06:06 -04:00
inode.c adfs: remove the big kernel lock 2011-03-02 00:02:38 +01:00
Kconfig adfs: remove the big kernel lock 2011-03-02 00:02:38 +01:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
map.c Cleanup of adfs headers 2009-06-17 00:36:36 -04:00
super.c adfs: remove the big kernel lock 2011-03-02 00:02:38 +01:00