tools/sched_ext: scx_central: fix sched_setaffinity() call with the set size
authorDavid Carlier <devnexen@gmail.com>
Wed, 11 Feb 2026 21:30:27 +0000 (21:30 +0000)
committerTejun Heo <tj@kernel.org>
Thu, 12 Feb 2026 17:30:17 +0000 (07:30 -1000)
commit988369d236e46e6bc68d2616fbc008aa6b06a454
tree84a01545b76fc847714d87ef0bec8eb3ade0df06
parent11fece49e956ef97318177f5af15a84317594244
tools/sched_ext: scx_central: fix sched_setaffinity() call with the set size

The cpu set is dynamically allocated for nr_cpu_ids using CPU_ALLOC(),
so the size passed to sched_setaffinity() should be CPU_ALLOC_SIZE()
rather than sizeof(cpu_set_t). Valgrind flagged this as accessing
unaddressable bytes past the allocation.

Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
tools/sched_ext/scx_central.c