Re: [PATCHv2 05/12] mm, rmap: check all VMAs that PTE-mapped THP can be part of

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On January 26, 2017 2:26 AM Kirill A. Shutemov wrote: 
> @@ -333,12 +333,15 @@ __vma_address(struct page *page, struct vm_area_struct *vma)
>  static inline unsigned long
>  vma_address(struct page *page, struct vm_area_struct *vma)
>  {
> -	unsigned long address = __vma_address(page, vma);
> +	unsigned long start, end;
> +
> +	start = __vma_address(page, vma);
> +	end = start + PAGE_SIZE * (hpage_nr_pages(page) - 1);
> 
>  	/* page should be within @vma mapping range */
> -	VM_BUG_ON_VMA(address < vma->vm_start || address >= vma->vm_end, vma);
> +	VM_BUG_ON_VMA(end < vma->vm_start || start >= vma->vm_end, vma);
> 
> -	return address;
> +	return max(start, vma->vm_start);
>  }
Nit: currently it's buggy if page is not within the mapping range.
In this work fix is added for start if unlikely it goes outside range, and 
its currently relevant debugging is cut off.

Other than that,
Acked-by: Hillf Danton <hillf.zj@xxxxxxxxxxxxxxx>


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux