From: Denys Vlasenko Date: Sat, 9 Nov 2019 16:32:43 +0000 (+0100) Subject: taskset: tighten the check for stride values X-Git-Tag: 1_32_0~104 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b230fdfa9da2f31e6cc90f90579c6d020c770f86;p=oweals%2Fbusybox.git taskset: tighten the check for stride values function old new delta taskset_main 986 987 +1 Signed-off-by: Denys Vlasenko --- diff --git a/util-linux/taskset.c b/util-linux/taskset.c index df1bc0a4f..b542f8c83 100644 --- a/util-linux/taskset.c +++ b/util-linux/taskset.c @@ -149,8 +149,8 @@ static void parse_cpulist(ul *mask, unsigned max, char *s) if ((*s != ',' && *s != '\0') || bit > end || end == UINT_MAX /* bb_strtou returns this on malformed / ERANGE numbers */ - || stride == 0 - || stride == UINT_MAX + || (stride - 1) > (UINT_MAX / 4) + /* disallow 0, malformed input, and too large stride prone to overflows */ ) { bb_error_msg_and_die("bad affinity '%s'", aff); }