From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761661AbcIYX2d (ORCPT ); Sun, 25 Sep 2016 19:28:33 -0400 Received: from mail-oi0-f50.google.com ([209.85.218.50]:34895 "EHLO mail-oi0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752998AbcIYX2b (ORCPT ); Sun, 25 Sep 2016 19:28:31 -0400 Date: Sun, 25 Sep 2016 16:28:22 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Linus Torvalds cc: Konstantin Khlebnikov , Rik van Riel , Hugh Dickins , Lorenzo Stoakes , linux-mm , Mel Gorman , tbsaunde@tbsaunde.org, robert@ocallahan.org, Linux Kernel Mailing List , Andrew Morton Subject: Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA balancing In-Reply-To: Message-ID: References: <20160911225425.10388-1-lstoakes@gmail.com> <20160925184731.GA20480@lucifer> <1474842875.17726.38.camel@redhat.com> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 25 Sep 2016, Linus Torvalds wrote: > On Sun, Sep 25, 2016 at 3:34 PM, Rik van Riel wrote: > > > > The patch looks good to me, too. > > > > Acked-by: Rik van Riel > > 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, and I also realize that right now we only have > a read/write flag, and we have that whole issue with "what if it's > executable but not readable", which currently FOLL_FORCE makes a > non-issue. > > But at the same time, FOLL_FORCE really is a major nasty thing. It > shouldn't be a security issue (we still do check VM_MAY_READ/WRITE etc > to verify that even if something isn't readable or writable we *could* > have had permissions to do this), but this bug is a prime example of > how it violates our deeply held beliefs of how VM permissions *should* > work, and it screwed up the numa case as a result. > > So how about we consider getting rid of FOLL_FORCE? Addign Hugh > Dickins to the cc, because I think he argued for that many moons ago.. No. You do remember half-right, because there was a bizarre aspect of write,force that Nick and I campaigned to remove, which in the end cda540ace6a1 ("mm: get_user_pages(write,force) refuse to COW in shared areas") got rid of - see that commit for details. I don't have any objections to force now, though I haven't been reading this thread to see if it would change my mind (and now I must dash out). But someone else who had concerns about it, I forget whether resolved or not by cda5, was Konstantin - baton passed. Hugh