diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2011-09-12 13:21:57 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2011-09-12 13:21:57 -0400 |
commit | 01b86011fd4b0069e1de1d64a483f158099751f6 (patch) | |
tree | 1d7feda8f482a530412cd4930b222c8e5bf19701 | |
parent | 6c9e3addce876b5cd708dcc1000c1aa52ec3284c (diff) | |
download | longterm-queue-2.6.34-01b86011fd4b0069e1de1d64a483f158099751f6.tar.gz |
add CVE-2011-1577 patch
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r-- | queue/fs-partitions-efi.c-corrupted-GUID-partition-tables-.patch | 62 | ||||
-rw-r--r-- | queue/series | 3 |
2 files changed, 65 insertions, 0 deletions
diff --git a/queue/fs-partitions-efi.c-corrupted-GUID-partition-tables-.patch b/queue/fs-partitions-efi.c-corrupted-GUID-partition-tables-.patch new file mode 100644 index 0000000..c061c90 --- /dev/null +++ b/queue/fs-partitions-efi.c-corrupted-GUID-partition-tables-.patch @@ -0,0 +1,62 @@ +From 1b2e5319e192a0de0009526915a5f31da0262ec1 Mon Sep 17 00:00:00 2001 +From: Timo Warns <Warns@pre-sense.de> +Date: Thu, 26 May 2011 16:25:57 -0700 +Subject: [PATCH] fs/partitions/efi.c: corrupted GUID partition tables can + cause kernel oops + +commit 3eb8e74ec72736b9b9d728bad30484ec89c91dde upstream. + +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] +[PG: replace state->bdev with bdev, since 1493bf217f7f isn't in 34] + +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> +Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> + +diff --git a/fs/partitions/efi.c b/fs/partitions/efi.c +index 91babda..7bb9f67 100644 +--- a/fs/partitions/efi.c ++++ b/fs/partitions/efi.c +@@ -312,6 +312,15 @@ is_gpt_valid(struct block_device *bdev, u64 lba, + goto fail; + } + ++ /* Check the GUID Partition Table header size */ ++ if (le32_to_cpu((*gpt)->header_size) > ++ bdev_logical_block_size(bdev)) { ++ pr_debug("GUID Partition Table Header size is wrong: %u > %u\n", ++ le32_to_cpu((*gpt)->header_size), ++ bdev_logical_block_size(bdev)); ++ goto fail; ++ } ++ + /* Check the GUID Partition Table CRC */ + origcrc = le32_to_cpu((*gpt)->header_crc32); + (*gpt)->header_crc32 = 0; +-- +1.7.4.4 + diff --git a/queue/series b/queue/series index 469fef7..c71d83e 100644 --- a/queue/series +++ b/queue/series @@ -74,3 +74,6 @@ dccp-handle-invalid-feature-options-length.patch # Content taken from v2.6.32.43 taskstats-don-t-allow-duplicate-entries-in-listener-.patch + +# others +fs-partitions-efi.c-corrupted-GUID-partition-tables-.patch |