From 96ee6a0c831b01cdd3b91203bb7f6892081101a8 Mon Sep 17 00:00:00 2001 From: shangyibin Date: Wed, 16 Mar 2022 14:11:16 +0800 Subject: [PATCH] prlimit fix optional arguments parsing --- ...limit-fix-optional-arguments-parsing.patch | 31 +++++++++++++++++++ util-linux.spec | 11 +++++-- 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 backport-prlimit-fix-optional-arguments-parsing.patch diff --git a/backport-prlimit-fix-optional-arguments-parsing.patch b/backport-prlimit-fix-optional-arguments-parsing.patch new file mode 100644 index 0000000..1bd5540 --- /dev/null +++ b/backport-prlimit-fix-optional-arguments-parsing.patch @@ -0,0 +1,31 @@ +From 1ad8db5521ec03d41a058674437f648d15ef8344 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 18 Mar 2021 10:23:36 +0100 +Subject: [PATCH] prlimit: fix optional arguments parsing + + $ prlimit -f=100:100 + failed to parse FSIZE limit + +Fixes: https://github.com/karelzak/util-linux/issues/1265 +Signed-off-by: Karel Zak +--- + sys-utils/prlimit.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/sys-utils/prlimit.c b/sys-utils/prlimit.c +index 6078490..17db3d8 100644 +--- a/sys-utils/prlimit.c ++++ b/sys-utils/prlimit.c +@@ -451,6 +451,9 @@ static int parse_prlim(struct rlimit *lim, char *ops, size_t id) + rlim_t soft, hard; + int found = 0; + ++ if (ops && *ops == '=') ++ ops++; ++ + if (get_range(ops, &soft, &hard, &found)) + errx(EXIT_FAILURE, _("failed to parse %s limit"), + prlimit_desc[id].name); +-- +1.8.3.1 + diff --git a/util-linux.spec b/util-linux.spec index 733ba6a..09895bc 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -2,7 +2,7 @@ Name: util-linux Version: 2.35.2 -Release: 10 +Release: 11 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 @@ -61,6 +61,7 @@ Patch6000: backport-CVE-2021-37600.patch Patch6001: backport-add-ul_strtou64.patch Patch6002: backport-CVE-2021-3995.patch Patch6003: backport-CVE-2021-3996.patch +Patch6004: backport-prlimit-fix-optional-arguments-parsing.patch Patch9000: Add-check-to-resolve-uname26-version-test-failed.patch Patch9001: modify-rescuemode-chinese-error.patch @@ -410,7 +411,13 @@ fi %{_mandir}/man8/{swapoff.8*,swapon.8*,switch_root.8*,umount.8*,wdctl.8.gz,wipefs.8*,zramctl.8*} %changelog -* Tue Feb 15 2021 shangyibin - 2.35.2-10 +* Wed Mar 16 2022 shangyibin - 2.35.2-11 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:prlimit fix optional arguments parsing + +* Tue Feb 15 2022 shangyibin - 2.35.2-10 - Type:CVE - ID:CVE-2021-3995 CVE-2021-3996 - SUG:NA