]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tools/sched_ext: fix strtoul() misuse in scx_hotplug_seq()
authorDavid Carlier <devnexen@gmail.com>
Fri, 27 Feb 2026 18:43:09 +0000 (18:43 +0000)
committerTejun Heo <tj@kernel.org>
Fri, 27 Feb 2026 19:17:44 +0000 (09:17 -1000)
commit032e084f0d43fda78c33abfc704ac13a0891a6e7
tree21d378ebcdeb897767b3a8a2932459d30410de19
parent749989b2d90ddc7dd253ad3b11a77cf882721acf
tools/sched_ext: fix strtoul() misuse in scx_hotplug_seq()

scx_hotplug_seq() uses strtoul() but validates the result with a
negative check (val < 0), which can never be true for an unsigned
return value.

Use the endptr mechanism to verify the entire string was consumed,
and check errno == ERANGE for overflow detection.

Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
tools/sched_ext/include/scx/compat.h