lkml.org 
[lkml]   [2014]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: PROBLEM: repeated remap_file_pages on tmpfs triggers bug on process exit
From
On Tue, Jul 15, 2014 at 2:55 PM, Kirill A. Shutemov
<kirill.shutemov@linux.intel.com> wrote:
> Konstantin Khlebnikov wrote:
>> It seems boundng logic in do_fault_around is wrong:
>>
>> start_addr = max(address & fault_around_mask(), vma->vm_start);
>> off = ((address - start_addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1);
>> pte -= off;
>> pgoff -= off;
>>
>> Ok, off <= 511, but it might be bigger than pte offset in pte table.
>
> I don't see how it possible: fault_around_mask() cannot be more than 0x1ff000
> (x86-64, fault_around_bytes == 2M). It means start_addr will be aligned to 2M
> boundary in this case which is start of the page table pte belong to.
>
> Do I miss something?

Nope, you're right. This fixes kernel crash but not the original problem.

Problem is caused by calling do_fault_around for _non-linear_ faiult.
In this case pgoff is shifted and might become negative during calculation.
I'll send another patch.

>
> --
> Kirill A. Shutemov


\
 
 \ /
  Last update: 2014-07-15 14:21    [W:0.111 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site