diff options
author | Wenlin Kang <wenlin.kang@windriver.com> | 2019-10-15 15:27:43 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-10-19 23:18:33 +0100 |
commit | b514e1f0bed9856d00afc8832b18dcff31ee4a98 (patch) | |
tree | a3d8399d087660a7c8891598508d7a81fdb3797e /meta/recipes-extended | |
parent | 911d784d9c838567dea40b94156e436d70b61c20 (diff) | |
download | poky-b514e1f0bed9856d00afc8832b18dcff31ee4a98.tar.gz |
sysstat: fix CVE-2019-16167
This commit is another part of CVE-2019-16167, please see
https://github.com/sysstat/sysstat/issues/232.
(From OE-Core rev: 586c045eb81b79200b46bf743f5d3fdb5f68c12d)
Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r-- | meta/recipes-extended/sysstat/sysstat/0001-Fix-232-Memory-corruption-bug-due-to-Integer-Overflo.patch | 46 | ||||
-rw-r--r-- | meta/recipes-extended/sysstat/sysstat_12.1.6.bb | 4 |
2 files changed, 49 insertions, 1 deletions
diff --git a/meta/recipes-extended/sysstat/sysstat/0001-Fix-232-Memory-corruption-bug-due-to-Integer-Overflo.patch b/meta/recipes-extended/sysstat/sysstat/0001-Fix-232-Memory-corruption-bug-due-to-Integer-Overflo.patch new file mode 100644 index 0000000000..46b111806c --- /dev/null +++ b/meta/recipes-extended/sysstat/sysstat/0001-Fix-232-Memory-corruption-bug-due-to-Integer-Overflo.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | From 603ae4ed8cd65abf0776ef7f68354a5c24a3411c Mon Sep 17 00:00:00 2001 | ||
2 | From: Sebastien GODARD <sysstat@users.noreply.github.com> | ||
3 | Date: Tue, 15 Oct 2019 14:39:33 +0800 | ||
4 | Subject: [PATCH] Fix #232: Memory corruption bug due to Integer Overflow in | ||
5 | remap_struct() | ||
6 | |||
7 | Try to avoid integer overflow when reading a corrupted binary datafile | ||
8 | with sadf. | ||
9 | |||
10 | Upstream-Status: Backport [https://github.com/sysstat/sysstat/commit/83fad9c895d1ac13f76af5883b7451b3302beef5] | ||
11 | CVE: CVE-2019-16167 | ||
12 | |||
13 | Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com> | ||
14 | Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com> | ||
15 | --- | ||
16 | sa_common.c | 7 +++++-- | ||
17 | 1 file changed, 5 insertions(+), 2 deletions(-) | ||
18 | |||
19 | diff --git a/sa_common.c b/sa_common.c | ||
20 | index 395c11c..cfa9007 100644 | ||
21 | --- a/sa_common.c | ||
22 | +++ b/sa_common.c | ||
23 | @@ -1336,7 +1336,8 @@ int remap_struct(unsigned int gtypes_nr[], unsigned int ftypes_nr[], | ||
24 | /* Remap [unsigned] int fields */ | ||
25 | d = gtypes_nr[1] - ftypes_nr[1]; | ||
26 | if (d) { | ||
27 | - if (ftypes_nr[1] * UL_ALIGNMENT_WIDTH < ftypes_nr[1]) | ||
28 | + if (gtypes_nr[0] * ULL_ALIGNMENT_WIDTH + | ||
29 | + ftypes_nr[1] * UL_ALIGNMENT_WIDTH < ftypes_nr[1]) | ||
30 | /* Overflow */ | ||
31 | return -1; | ||
32 | |||
33 | @@ -1365,7 +1366,9 @@ int remap_struct(unsigned int gtypes_nr[], unsigned int ftypes_nr[], | ||
34 | /* Remap possible fields (like strings of chars) following int fields */ | ||
35 | d = gtypes_nr[2] - ftypes_nr[2]; | ||
36 | if (d) { | ||
37 | - if (ftypes_nr[2] * U_ALIGNMENT_WIDTH < ftypes_nr[2]) | ||
38 | + if (gtypes_nr[0] * ULL_ALIGNMENT_WIDTH + | ||
39 | + gtypes_nr[1] * UL_ALIGNMENT_WIDTH + | ||
40 | + ftypes_nr[2] * U_ALIGNMENT_WIDTH < ftypes_nr[2]) | ||
41 | /* Overflow */ | ||
42 | return -1; | ||
43 | |||
44 | -- | ||
45 | 1.9.1 | ||
46 | |||
diff --git a/meta/recipes-extended/sysstat/sysstat_12.1.6.bb b/meta/recipes-extended/sysstat/sysstat_12.1.6.bb index 8cf8c36d9b..362888d506 100644 --- a/meta/recipes-extended/sysstat/sysstat_12.1.6.bb +++ b/meta/recipes-extended/sysstat/sysstat_12.1.6.bb | |||
@@ -2,7 +2,9 @@ require sysstat.inc | |||
2 | 2 | ||
3 | LIC_FILES_CHKSUM = "file://COPYING;md5=a23a74b3f4caf9616230789d94217acb" | 3 | LIC_FILES_CHKSUM = "file://COPYING;md5=a23a74b3f4caf9616230789d94217acb" |
4 | 4 | ||
5 | SRC_URI += "file://0001-Include-needed-headers-explicitly.patch" | 5 | SRC_URI += "file://0001-Include-needed-headers-explicitly.patch \ |
6 | file://0001-Fix-232-Memory-corruption-bug-due-to-Integer-Overflo.patch \ | ||
7 | " | ||
6 | 8 | ||
7 | SRC_URI[md5sum] = "d8e3bbb9c873dd370f6d33664e326570" | 9 | SRC_URI[md5sum] = "d8e3bbb9c873dd370f6d33664e326570" |
8 | SRC_URI[sha256sum] = "f752f3c406153a6fc446496f1102872505ace3f0931d975c1d664c81ec09f129" | 10 | SRC_URI[sha256sum] = "f752f3c406153a6fc446496f1102872505ace3f0931d975c1d664c81ec09f129" |