Re: [mm 4.15-rc8] Random oopses under memory pressure.

From: Linus Torvalds
Date: Thu Jan 18 2018 - 11:58:47 EST


On Thu, Jan 18, 2018 at 6:38 AM, Dave Hansen
<dave.hansen@xxxxxxxxxxxxxxx> wrote:
> On 01/18/2018 05:12 AM, Kirill A. Shutemov wrote:
>> - if (pte_page(*pvmw->pte) - pvmw->page >=
>> - hpage_nr_pages(pvmw->page)) {
>
> Is ->pte guaranteed to map a page which is within the same section as
> pvmw->page? Otherwise, with sparsemem (non-vmemmap), the pointer
> arithmetic won't work.

Lovely.

Finally a reason for this bug that actually seems to make sense.

Thanks guys.

Tetsuo - does Kirill's latest patch fix this for you? The one with

Subject: [PATCH] mm, page_vma_mapped: Fix pointer arithmetics in check_pte()

in the body of the email? I'm really hoping it does, since this seems
to make sense.

Linus