summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/util-linux/util-linux/CVE-2016-5011.patch
diff options
context:
space:
mode:
authorArmin Kuster <akuster@mvista.com>2016-09-19 21:51:14 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-23 23:22:04 +0100
commit2804850ea7b030be9b36ea1af03cd80d90466707 (patch)
tree9e4da46e82744cc0d180bc5bbd8cb6368eeecdc7 /meta/recipes-core/util-linux/util-linux/CVE-2016-5011.patch
parent6998a3c1e64869b720c49f45af37862646ac5dff (diff)
downloadpoky-2804850ea7b030be9b36ea1af03cd80d90466707.tar.gz
util-linux: Security fix for CVE-2016-5011
affects util-linux < 2.28.2 (From OE-Core rev: c9c85df86cd2270b144fa824ef76adedd3636c8a) Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/util-linux/util-linux/CVE-2016-5011.patch')
-rw-r--r--meta/recipes-core/util-linux/util-linux/CVE-2016-5011.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/meta/recipes-core/util-linux/util-linux/CVE-2016-5011.patch b/meta/recipes-core/util-linux/util-linux/CVE-2016-5011.patch
new file mode 100644
index 0000000000..9571280dc9
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/CVE-2016-5011.patch
@@ -0,0 +1,59 @@
1From 7164a1c34d18831ac61c6744ad14ce916d389b3f Mon Sep 17 00:00:00 2001
2From: Karel Zak <kzak@redhat.com>
3Date: Thu, 7 Jul 2016 14:22:41 +0200
4Subject: [PATCH] libblkid: ignore extended partition at zero offset
5
6If the extended partition starts at zero LBA then MBR is interpreted
7as EBR and all is recursively parsed... result is out-of-memory.
8
9 MBR --extended-partition--> EBR --> MBR --> ENB --> MBR ...
10
11Note that such PT is not possible to create by standard partitioning
12tools.
13
14Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1349536
15Signed-off-by: Karel Zak <kzak@redhat.com>
16
17Upstream-status: Backport
18CVE: CVE-2016-5011 patch 1
19Signed-off-by: Armin Kuster <akuster@mvista.com>
20
21---
22 libblkid/src/partitions/dos.c | 14 ++++++++++++--
23 1 file changed, 12 insertions(+), 2 deletions(-)
24
25diff --git a/libblkid/src/partitions/dos.c b/libblkid/src/partitions/dos.c
26index 9bba32f..e79f124 100644
27--- a/libblkid/src/partitions/dos.c
28+++ b/libblkid/src/partitions/dos.c
29@@ -47,6 +47,12 @@ static int parse_dos_extended(blkid_probe pr, blkid_parttable tab,
30 int ct_nodata = 0; /* count ext.partitions without data partitions */
31 int i;
32
33+ DBG(LOWPROBE, ul_debug("parse EBR [start=%d, size=%d]", ex_start/ssf, ex_size/ssf));
34+ if (ex_start == 0) {
35+ DBG(LOWPROBE, ul_debug("Bad offset in primary extended partition -- ignore"));
36+ return 0;
37+ }
38+
39 while (1) {
40 struct dos_partition *p, *p0;
41 uint32_t start, size;
42@@ -116,8 +122,12 @@ static int parse_dos_extended(blkid_probe pr, blkid_parttable tab,
43 start = dos_partition_get_start(p) * ssf;
44 size = dos_partition_get_size(p) * ssf;
45
46- if (size && is_extended(p))
47- break;
48+ if (size && is_extended(p)) {
49+ if (start == 0)
50+ DBG(LOWPROBE, ul_debug("#%d: EBR link offset is zero -- ignore", i + 1));
51+ else
52+ break;
53+ }
54 }
55 if (i == 4)
56 goto leave;
57--
582.7.4
59