diff --git a/backport-CVE-2021-37600.patch b/backport-CVE-2021-37600.patch new file mode 100644 index 0000000000000000000000000000000000000000..139656e7ca6500cb73b8de369eff78e6b71eb135 --- /dev/null +++ b/backport-CVE-2021-37600.patch @@ -0,0 +1,25 @@ +From 1c9143d0c1f979c3daf10e1c37b5b1e916c22a1c Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 27 Jul 2021 11:58:31 +0200 +Subject: [PATCH] sys-utils/ipcutils: be careful when call calloc() for uint64 + nmembs + +Fix: https://github.com/karelzak/util-linux/issues/1395 +Signed-off-by: Karel Zak +--- + sys-utils/ipcutils.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sys-utils/ipcutils.c b/sys-utils/ipcutils.c +index e784c4dcb9..18868cfd38 100644 +--- a/sys-utils/ipcutils.c ++++ b/sys-utils/ipcutils.c +@@ -218,7 +218,7 @@ static void get_sem_elements(struct sem_data *p) + { + size_t i; + +- if (!p || !p->sem_nsems || p->sem_perm.id < 0) ++ if (!p || !p->sem_nsems || p->sem_nsems > SIZE_MAX || p->sem_perm.id < 0) + return; + + p->elements = xcalloc(p->sem_nsems, sizeof(struct sem_elem)); diff --git a/util-linux.spec b/util-linux.spec index e16f2fa3b98d13e3baf6d9eeb6fbb4222d500791..2bfc2852e11cef550a43316372370fe84feef04d 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -2,7 +2,7 @@ Name: util-linux Version: 2.35.2 -Release: 7 +Release: 8 Summary: A random collection of Linux utilities License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain URL: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git @@ -57,6 +57,7 @@ Patch18: backport-libblkid-use-sys-to-read-all-block-devices.patch Patch19: backpaort-fix-rounding-in-size_to_human_string.patch Patch20: backpaort-fix-uint64_t-overflow.patch Patch21: backpaort-update-fdisk-outputs-due-to-sizes-rounding-change.patch +Patch6000: backport-CVE-2021-37600.patch Patch9000: Add-check-to-resolve-uname26-version-test-failed.patch @@ -406,6 +407,12 @@ fi %{_mandir}/man8/{swapoff.8*,swapon.8*,switch_root.8*,umount.8*,wdctl.8.gz,wipefs.8*,zramctl.8*} %changelog +* Tue Aug 10 2021 shixuantong - 2.35.2-8 +- Type:CVE +- ID:CVE-2021-37600 +- SUG:NA +- DESC:fix CVE-2021-37600 + * Wed Jul 28 2021 shangyibin - 2.35.2-7 - Type:bugfix - ID:NA