[Toybox] [PATCH] taskset: fix buffer overflow from long mask

David Seikel onefang_toybox at dave.isageek.net
Mon Jun 23 16:12:23 PDT 2025


On 2025-06-23 15:22:05, Rob Landley wrote:
> > Tested:
> > % toybox taskset $( yes f | head -n 8193 | tr -d '\n' ) true
> > taskset: mask too long
> > 
> > The util-linux taskset handles masks longer than zsh can construct:
> > taskset $( yes f | head -n 131000 | tr -d '\n' ) true
> 
> Before using a fixed 4k bitmap (32768 processors) for taskset I went down
> ANOTHER historical rathole, "how many processors can a Linux system actually
> have". I'm pretty sure I redid the research and actually wrote it down this
> time back when commit e2b17f5e0cd3 went in. Checking my blog back around
> then, we get:
> 
> https://landley.net/notes-2022.html#24-07-2022
> 
> Which said only IBM used more than 64 processors in a defconfig (some
> powerpc set NR_CPUS to 2048 and s390x could set it to 512). That symbol sets
> the size of the array and thus the maximum this kernel could handle, not the
> amount actually present on any given hardware instance (usually way fewer
> than that).

This probably isn't relevant, but the desktop computer I'm typing this on
has 64 cores.  Or 128 coz hyperthreading.  It's my super desktop, it has
way too much RAM as well.

-- 
A big old stinking pile of genius that no one wants
coz there are too many silver coated monkeys in the world.


More information about the Toybox mailing list