summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0035-udf-Improve-table-length-check-to-avoid-possible-ove.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0035-udf-Improve-table-length-check-to-avoid-possible-ove.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0035-udf-Improve-table-length-check-to-avoid-possible-ove.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0035-udf-Improve-table-length-check-to-avoid-possible-ove.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0035-udf-Improve-table-length-check-to-avoid-possible-ove.patch
new file mode 100644
index 00000000..2548a59d
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0035-udf-Improve-table-length-check-to-avoid-possible-ove.patch
@@ -0,0 +1,36 @@
1From 27f12e5bea3378be70c81b258660fcaa44496cb4 Mon Sep 17 00:00:00 2001
2From: Jan Kara <jack@suse.cz>
3Date: Tue, 10 Jul 2012 17:58:04 +0200
4Subject: [PATCH 35/73] udf: Improve table length check to avoid possible
5 overflow
6
7commit 57b9655d01ef057a523e810d29c37ac09b80eead upstream.
8
9When a partition table length is corrupted to be close to 1 << 32, the
10check for its length may overflow on 32-bit systems and we will think
11the length is valid. Later on the kernel can crash trying to read beyond
12end of buffer. Fix the check to avoid possible overflow.
13
14Reported-by: Ben Hutchings <ben@decadent.org.uk>
15Signed-off-by: Jan Kara <jack@suse.cz>
16Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
17---
18 fs/udf/super.c | 2 +-
19 1 files changed, 1 insertions(+), 1 deletions(-)
20
21diff --git a/fs/udf/super.c b/fs/udf/super.c
22index 270e135..516b7f0 100644
23--- a/fs/udf/super.c
24+++ b/fs/udf/super.c
25@@ -1285,7 +1285,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
26 BUG_ON(ident != TAG_IDENT_LVD);
27 lvd = (struct logicalVolDesc *)bh->b_data;
28 table_len = le32_to_cpu(lvd->mapTableLength);
29- if (sizeof(*lvd) + table_len > sb->s_blocksize) {
30+ if (table_len > sb->s_blocksize - sizeof(*lvd)) {
31 udf_err(sb, "error loading logical volume descriptor: "
32 "Partition table too long (%u > %lu)\n", table_len,
33 sb->s_blocksize - sizeof(*lvd));
34--
351.7.7.6
36