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

Linus Torvalds
2015-06-24T19:15:58Z

On Wed, Jun 24, 2015 at 11:49 AM, Mathieu Desnoyers
<mathieu.desnoyers@efficios.com> 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