Re: [PATCHv2 1/2] x86/mm: Do not allow non-MAP_FIXED mapping across DEFAULT_MAP_WINDOW border

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

 



On Wed, Nov 15, 2017 at 03:23:32PM +0100, Thomas Gleixner wrote:
> On Wed, 15 Nov 2017, Kirill A. Shutemov wrote:
> > On Wed, Nov 15, 2017 at 05:04:26PM +0300, Kirill A. Shutemov wrote:
> >  	/* requesting a specific address */
> >  	if (addr) {
> > -		addr = PAGE_ALIGN(addr);
> > +		addr &= PAGE_MASK;
> >  		if (!mmap_address_hint_valid(addr, len))
> >  			goto get_unmapped_area;
> >  
> > diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
> > index 92db903c3dad..00b296617ca4 100644
> > --- a/arch/x86/mm/hugetlbpage.c
> > +++ b/arch/x86/mm/hugetlbpage.c
> > @@ -166,7 +166,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
> >  	}
> >  
> >  	if (addr) {
> > -		addr = ALIGN(addr, huge_page_size(h));
> > +		addr &= huge_page_mask(h);
> >  		if (!mmap_address_hint_valid(addr, len))
> >  			goto get_unmapped_area;
> 
> That should work. Care to pickup my variant, make the fixups and resend
> along with the selftest which covers both normal and huge mappings?

Sure.

-- 
 Kirill A. Shutemov

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