On Mon, Mar 22, 2021 at 10:40:26AM +0000, Nikos Nikoleris wrote: > > Prior to this change, a call of cpumask_next(cpu, mask) where cpu=nr_cpu > - 1 (assuming all cpus are enumerated in the range 0..nr_cpus - 1) would > make an out-of-bounds access to the mask. In many cases, this is still a > valid memory location due the implementation of cpumask_t, however, in > certain configurations (for example, nr_cpus == sizeof(long)) this would > cause an access outside the bounds of the mask too. > > This patch changes the way we guard calls to cpumask_test_cpu() in > cpumask_next() to avoid the above condition. A following change adds > assertions to catch out-of-bounds accesses to cpumask_t. > Thanks, I've added it. It looks like Alexandru would also like commit message improvements. I can add those too. Thanks, drew