← Commit list

b230fdfa9

Denys Vlasenko
Denys Vlasenko
2019-11-09
SUCCESS Duration: 154s

Subject

taskset: tighten the check for stride values

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

util-linux/taskset.c+2 -2
@@ -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);
}