diff options
author | Dragos-Marian Panait <dragos.panait@windriver.com> | 2021-08-10 12:27:34 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-08-13 14:44:05 +0100 |
commit | b3246ebd87a4d0b4934ff48c7ce874d0499711dc (patch) | |
tree | b530014e5b15ebc50bbc0bb07cd3d6a945fdbc79 | |
parent | 4e413911df6d981dc091734eba411fd89e16d7db (diff) | |
download | poky-b3246ebd87a4d0b4934ff48c7ce874d0499711dc.tar.gz |
util-linux: fix CVE-2021-37600
sys-utils/ipcutils: be careful when call calloc() for uint64 nmembs
Fix: #1395
(From OE-Core rev: 9822232b4abd811bb9c8562f98c0aefc748340a0)
Signed-off-by: Karel Zak <kzak@redhat.com>
CVE: CVE-2021-37600
Upstream-Status: Backport [1c9143d0c1f979c3daf10e1c37b5b1e916c22a1c]
Signed-off-by: Dragos-Marian Panait <dragos.panait@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-core/util-linux/util-linux.inc | 1 | ||||
-rw-r--r-- | meta/recipes-core/util-linux/util-linux/CVE-2021-37600.patch | 33 |
2 files changed, 34 insertions, 0 deletions
diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc index a76fb9e500..0f17c73e86 100644 --- a/meta/recipes-core/util-linux/util-linux.inc +++ b/meta/recipes-core/util-linux/util-linux.inc | |||
@@ -35,6 +35,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin | |||
35 | file://run-ptest \ | 35 | file://run-ptest \ |
36 | file://display_testname_for_subtest.patch \ | 36 | file://display_testname_for_subtest.patch \ |
37 | file://avoid_parallel_tests.patch \ | 37 | file://avoid_parallel_tests.patch \ |
38 | file://CVE-2021-37600.patch \ | ||
38 | " | 39 | " |
39 | 40 | ||
40 | SRC_URI[sha256sum] = "8e4bd42053b726cf86eb4d13a73bc1d9225a2c2e1a2e0d2a891f1020f83e6b76" | 41 | SRC_URI[sha256sum] = "8e4bd42053b726cf86eb4d13a73bc1d9225a2c2e1a2e0d2a891f1020f83e6b76" |
diff --git a/meta/recipes-core/util-linux/util-linux/CVE-2021-37600.patch b/meta/recipes-core/util-linux/util-linux/CVE-2021-37600.patch new file mode 100644 index 0000000000..2b306c435b --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/CVE-2021-37600.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From 1c9143d0c1f979c3daf10e1c37b5b1e916c22a1c Mon Sep 17 00:00:00 2001 | ||
2 | From: Karel Zak <kzak@redhat.com> | ||
3 | Date: Tue, 27 Jul 2021 11:58:31 +0200 | ||
4 | Subject: [PATCH] sys-utils/ipcutils: be careful when call calloc() for uint64 | ||
5 | nmembs | ||
6 | |||
7 | Fix: https://github.com/karelzak/util-linux/issues/1395 | ||
8 | Signed-off-by: Karel Zak <kzak@redhat.com> | ||
9 | |||
10 | CVE: CVE-2021-37600 | ||
11 | Upstream-Status: Backport [1c9143d0c1f979c3daf10e1c37b5b1e916c22a1c] | ||
12 | |||
13 | Signed-off-by: Dragos-Marian Panait <dragos.panait@windriver.com> | ||
14 | --- | ||
15 | sys-utils/ipcutils.c | 2 +- | ||
16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
17 | |||
18 | diff --git a/sys-utils/ipcutils.c b/sys-utils/ipcutils.c | ||
19 | index e784c4dcb..18868cfd3 100644 | ||
20 | --- a/sys-utils/ipcutils.c | ||
21 | +++ b/sys-utils/ipcutils.c | ||
22 | @@ -218,7 +218,7 @@ static void get_sem_elements(struct sem_data *p) | ||
23 | { | ||
24 | size_t i; | ||
25 | |||
26 | - if (!p || !p->sem_nsems || p->sem_perm.id < 0) | ||
27 | + if (!p || !p->sem_nsems || p->sem_nsems > SIZE_MAX || p->sem_perm.id < 0) | ||
28 | return; | ||
29 | |||
30 | p->elements = xcalloc(p->sem_nsems, sizeof(struct sem_elem)); | ||
31 | -- | ||
32 | 2.25.1 | ||
33 | |||