Re: obscure bug in vmalloc

Russell King (rmk@arm.linux.org.uk)
Thu, 1 Feb 2001 23:19:22 +0000 (GMT)


duane voth writes:
> duane voth wrote:
> > ... I've attached a patch that
> > can be used to watch for the problem. The following is a 2.2 patch (2.4
> > will follow in a few minutes). If you see "vmalloc error" you might want
> > to uncomment the look_for_dangling_pgds function to get a better feel for
> > the pgds that cause the probem.
>
> Here is the 2.4.1 version.

> +int
> +duanev_ensure_pgds_same(unsigned long addr, unsigned long size)
>...
> + for_each_task(p) {
> + for (va = addr; va < addr + size; va = (va + PGDIR_SIZE) & PGDIR_MASK) {
> + pgd_t kpgd = *pgd_offset_k(va);
> + if (pgd_val(*pgd_offset(p->mm, va)) != pgd_val(kpgd)) {
>...

In 2.4 kernels, it is legal for a processes pgds in the vmalloc area to be
different from those of the init task in so much as they may be entries
that will cause a fault. The page fault handler will then fill in the
pgd entry for us.

--
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html

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