Re: [RFC PATCH] Fix: x86 unaligned __memcpy to/from virtual memory

From: Linus Torvalds
Date: Wed Jun 24 2015 - 15:16:01 EST


On Wed, Jun 24, 2015 at 11:49 AM, Mathieu Desnoyers
<mathieu.desnoyers@xxxxxxxxxxxx> wrote:
>
> Here is the output. I added the printk just after the initial range
> check within vmalloc_fault.

Good. Can you add printk's to the error return paths too, so that we
see which one it is that triggers.

If it is a valid vmalloc address, then vmalloc_fault() _should_ just
fix it up and return 0. Clearly it doesn't, and hits one of the
"return -1" cases instead.

In particular, that

pgd_ref = pgd_offset_k(address);

should return the reference page table pointer for init_mm, which is
what vmalloc() itself *should* be populating.

The fact that it sounds like one of the "pud/pmd/pte_none()" checks
for the reference ends up returning true, seems to indicate that the
page tables haven't been filled in even for the reference address.
Which is really really odd.

I'm really inclined to think that it's something in lttng, because
it's so odd. A race with vunmap() on another CPU? How could
vmalloc_fault() not see the reference page table contents?

Linus
--
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/