> > +       int cpu, cnt = num_online_cpus();
> > +       cpumask_t mask = { CPU_BITS_NONE };
> > +       size_t size = 4097;     /* must be <= KMALLOC_MAX_CACHE_SIZE/2 */
> Can you please explicitly calculate |size| from KMALLOC_MAX_CACHE_SIZE?
> > +
> > +       if (cnt == 1)
> > +               return;
> > +       cnt = cnt < MAX_THREADS ? cnt : MAX_THREADS;
> > +       pr_info("concurrent double-free (%d threads)\n", cnt);
> > +       p = kmalloc(size, GFP_KERNEL);
> > +       if (!p)
> > +               return;
> > +       for_each_online_cpu(cpu) {
> > +               cpumask_set_cpu(cpu, &mask);
> > +               if (!--cnt)
> > +                       break;
> > +       }
> > +       on_each_cpu_mask(&mask, try_free, p, 0);
> > +}
> > +
> > +static noinline void __init kasan_double_free(void)
> > +{
> > +       char *p;
> > +       size_t size = 2049;
> Please avoid using magic constants.

Alexander,

Thanks very much for the review.  I've changed alloc size for both to 100
in v5.

Kuthonuzo

Reply via email to