lkml.org 
[lkml]   [2017]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv2 1/2] x86/mm: Do not allow non-MAP_FIXED mapping across DEFAULT_MAP_WINDOW border
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

\
 
 \ /
  Last update: 2017-11-15 15:25    [W:0.049 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site