Re: [BUG] Invalid return address of mmap() followed by mbind() in multithreaded context

From: Andi Kleen
Date: Sat Jun 18 2011 - 14:12:40 EST


> for (i = 0; i < NR_ITER; i++) {
> addr = mmap(0, PAGE_SIZE, PROT_READ | PROT_WRITE,
> MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
> if (addr == (void *) -1) {
> assert(0 && "mmap failed");
> }
> *addr = 0;
>
> err = mbind(addr, PAGE_SIZE, MPOL_BIND, &node, sizeof(node), 0);

mbind() can be only done before the first touch. you're not actually testing
numa policy.

-andi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/