Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1491016

Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA balancing

From Rik van Riel <riel@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA balancing
Date 2016-09-26 02:50 +0200
Message-ID <slshj-5cm-1@gated-at.bofh.it> (permalink)
References <sgm2R-3Vr-13@gated-at.bofh.it> <slmEV-1IC-13@gated-at.bofh.it> <sloGJ-2SM-5@gated-at.bofh.it> <slqfv-43C-19@gated-at.bofh.it> <slqyR-49T-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Sun, 2016-09-25 at 15:50 -0700, Linus Torvalds wrote:
> On Sun, Sep 25, 2016 at 3:34 PM, Rik van Riel <riel@redhat.com>
> wrote:
> > 
> > 
> > The patch looks good to me, too.
> > 
> > Acked-by: Rik van Riel <riel@redhat.com>
> 
> Thanks, amended the commit since I hadn't pushed out yet.
> 
> Btw, the only reason this bug could happen is that we do that
> "force=1" for remote vm accesses, which turns into FOLL_FORCE, which
> in turn will turn into us allowing an access even when we technically
> shouldn't.
> 
> I'd really like to re-open the "drop FOLL_FORCE entirely" discussion,
> because the thing really is disgusting.
> 
> I realize that debuggers etc sometimes would want to punch through
> PROT_NONE protections,

Reading the code for a little bit, it looks like get_user_pages
interprets both PROT_NONE and PAGE_NUMA ptes as present, and will
simply return the page to the caller.

Furthermore, if a page in a PROT_NONE VMA is actually not present,
it should be faulted in with PROT_NONE permissions, after which
the page is passed to the debugger.

That is, punching through PROT_NONE permissions should only happen
from outside of the process. Inside the process, PROT_NONE should
be preserved regardless of FOLL_FORCE.

-- 
All Rights Reversed.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA  balancing Lorenzo Stoakes <lstoakes@gmail.com> - 2016-09-25 20:50 +0200
  Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA balancing Linus Torvalds <torvalds@linux-foundation.org> - 2016-09-25 23:00 +0200
    Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA balancing Linus Torvalds <torvalds@linux-foundation.org> - 2016-09-26 00:30 +0200
    Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA  balancing Rik van Riel <riel@redhat.com> - 2016-09-26 00:40 +0200
      Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA balancing Linus Torvalds <torvalds@linux-foundation.org> - 2016-09-26 01:00 +0200
        Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA  balancing Hugh Dickins <hughd@google.com> - 2016-09-26 01:30 +0200
        Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA  balancing Rik van Riel <riel@redhat.com> - 2016-09-26 02:50 +0200
          Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA balancing Linus Torvalds <torvalds@linux-foundation.org> - 2016-09-26 03:10 +0200
        Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA  balancing Lorenzo Stoakes <lstoakes@gmail.com> - 2016-10-07 12:10 +0200
          Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA balancing Linus Torvalds <torvalds@linux-foundation.org> - 2016-10-07 17:40 +0200
            Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA  balancing Lorenzo Stoakes <lstoakes@gmail.com> - 2016-10-07 18:30 +0200
              Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA  balancing Hugh Dickins <hughd@google.com> - 2016-10-07 20:20 +0200
                Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA  balancing Lorenzo Stoakes <lstoakes@gmail.com> - 2016-10-07 20:30 +0200
                Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA  balancing Lorenzo Stoakes <lstoakes@gmail.com> - 2016-10-10 10:30 +0200
                Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA  balancing Jan Kara <jack@suse.cz> - 2016-10-10 18:40 +0200
                Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA  balancing Jan Kara <jack@suse.cz> - 2016-10-10 10:40 +0200

csiph-web