lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 7 Jun 2016 18:10:53 +0000
From:	"Luruo, Kuthonuzo" <kuthonuzo.luruo@....com>
To:	Alexander Potapenko <glider@...gle.com>
CC:	Andrey Ryabinin <aryabinin@...tuozzo.com>,
	Dmitriy Vyukov <dvyukov@...gle.com>,
	Christoph Lameter <cl@...ux.com>,
	"penberg@...nel.org" <penberg@...nel.org>,
	"rientjes@...gle.com" <rientjes@...gle.com>,
	"Joonsoo Kim" <iamjoonsoo.kim@....com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	kasan-dev <kasan-dev@...glegroups.com>,
	LKML <linux-kernel@...r.kernel.org>,
	"ynorov@...iumnetworks.com" <ynorov@...iumnetworks.com>
Subject: RE: [PATCH v4 2/2] kasan: add double-free tests

> > +       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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ