kernel_optimize_test/fs/partitions
Timo Warns 3eb8e74ec7 fs/partitions/efi.c: corrupted GUID partition tables can cause kernel oops
The kernel automatically evaluates partition tables of storage devices.
The code for evaluating GUID partitions (in fs/partitions/efi.c) contains
a bug that causes a kernel oops on certain corrupted GUID partition
tables.

This bug has security impacts, because it allows, for example, to
prepare a storage device that crashes a kernel subsystem upon connecting
the device (e.g., a "USB Stick of (Partial) Death").

	crc = efi_crc32((const unsigned char *) (*gpt), le32_to_cpu((*gpt)->header_size));

computes a CRC32 checksum over gpt covering (*gpt)->header_size bytes.
There is no validation of (*gpt)->header_size before the efi_crc32 call.

A corrupted partition table may have large values for (*gpt)->header_size.
 In this case, the CRC32 computation access memory beyond the memory
allocated for gpt, which may cause a kernel heap overflow.

Validate value of GUID partition table header size.

[akpm@linux-foundation.org: fix layout and indenting]
Signed-off-by: Timo Warns <warns@pre-sense.de>
Cc: Matt Domsch <Matt_Domsch@dell.com>
Cc: Eugene Teo <eugeneteo@kernel.sg>
Cc: Dave Jones <davej@codemonkey.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-05-26 17:12:37 -07:00
..
acorn.c
acorn.h
amiga.c
amiga.h
atari.c
atari.h
check.c fs: fixup warning part_discard_alignment_show() 2011-05-09 08:28:13 +02:00
check.h block, partition: add partition_meta_info to hd_struct 2010-09-15 16:13:18 +02:00
efi.c fs/partitions/efi.c: corrupted GUID partition tables can cause kernel oops 2011-05-26 17:12:37 -07:00
efi.h
ibm.c [S390] partitions: fix build error in ibm partition detection code 2010-08-13 10:06:55 +02:00
ibm.h
karma.c
karma.h
Kconfig
ldm.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2011-05-23 09:12:26 -07:00
ldm.h Update broken web addresses in the kernel. 2010-10-18 11:03:14 +02:00
mac.c fs/partitions: Validate map_count in Mac partition tables 2011-02-17 17:50:51 -08:00
mac.h
Makefile
msdos.c
msdos.h
osf.c Increase OSF partition limit from 8 to 18 2011-03-16 08:04:07 -07:00
osf.h
sgi.c
sgi.h
sun.c
sun.h
sysv68.c
sysv68.h
ultrix.c
ultrix.h