Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4746125imm; Mon, 14 May 2018 12:16:22 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp7s9ZvV2+YK7+VML0Y3xlR9QEcuiztFQNWwJigPGzpbnd4/8bX+yxf2HsN0+IbXtXnmK/E X-Received: by 2002:a17:902:6b8b:: with SMTP id p11-v6mr10872489plk.212.1526325382385; Mon, 14 May 2018 12:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526325382; cv=none; d=google.com; s=arc-20160816; b=umNMCI8DYNsTbjw8NTw/8v4Xi5x8NQE8x7ogDX882uA3t7ZyiobENKj0zW6z1bOQ1H WEWefX4Ji42b/My2iGyH4fm/esywXAXPIZrkzUpmG9SClWdUJ1TeWujo6yNg2vKBEGgk 2+CtcOzcD18FHy0bCoGrIHV+xZdCyhj229DUedSpficirRRTz1BfJCH4/2VAyb/lmxR1 /ZotlVNIQKFc4zfITEturvwj4pOEhVSnpJS8llTe0KgpoZYzEs7PgMFDsFcIBIoL6M/a aP/P0y8uKnTkhnrHjT4P9vLORrMGLWPukoSy7LSJgag/5EsY/vbDPJSlnHulNvnzRI3S yPcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=7aiSQAaM0sSuWI35DOnJ81WMZq0Dw9qSMKmMMmLjyR4=; b=Pc3nX1jsvIETqlpOayG2f1HoxT2FtICP37mCW+czZ/7Ct6XDfKZDYLxbwvp3kqNCFh afW6zM6fNIkWmkyOnKHDxIalATCweOcrc9WfiqD2pgs05Fn2xkprGF+qZvBQI6syLHRA qxft682IYoO4rFnjba9N0BieKhXvKUcC+Xu16TmeIvKX1Llc/6silMBHdPJ6u77X8+U2 Z9X6kXeElZliRpC9SIalaRdUa/XWPhd1K2St6aLIvXB4TJQRHw5CU9u3G45S/nnaYspc kqXhbXvcZ5KNxuQMToX/WHwpxN6N3Zq3WNYJAyUIBp0mVAnS4PVJecm10IBq4241PA8f /A3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=VWqLRbnk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o23-v6si9529466pll.54.2018.05.14.12.16.07; Mon, 14 May 2018 12:16:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=VWqLRbnk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752015AbeENTP5 (ORCPT + 99 others); Mon, 14 May 2018 15:15:57 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:33228 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750760AbeENTP4 (ORCPT ); Mon, 14 May 2018 15:15:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=7aiSQAaM0sSuWI35DOnJ81WMZq0Dw9qSMKmMMmLjyR4=; b=VWqLRbnk9nFIJX0PdYzhvjA0r iuZgt8GNZWwllc2VlGAoO9iLYCVI4cdn3e6B1a8fWj+JfrQwFHcIy4a6I0qo+9znafvrb9MQRvD51 ggmLvTGpwe193MUYVgfvrYJ8PmIX5ami2kjKy+7YqGLspGFOGf7OcGcmSpaNR/PSURt+vs8LCE8/n 4zCVspWd8pGCEyuRr3mUj3nCh3if+FpIAB/CUqPa36FYCwEpZnmttKlA4kBplORu0jpbDJb5I2UC0 ufymU/w2v3b9mIybGYgYARkbfsC/Ca3RewdcUHJ0xFIYX/wIpC1uecZtKoV2WXCx8WYHiW3k3TJyH w7MiMm93w==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIIwp-0005m1-D0; Mon, 14 May 2018 19:15:51 +0000 Date: Mon, 14 May 2018 12:15:51 -0700 From: Matthew Wilcox To: Boaz Harrosh Cc: Jeff Moyer , Andrew Morton , "Kirill A. Shutemov" , linux-kernel , linux-fsdevel , "linux-mm@kvack.org" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Peter Zijlstra , Dave Hansen , Rik van Riel , Jan Kara , Matthew Wilcox , Amit Golander Subject: Re: [PATCH] mm: Add new vma flag VM_LOCAL_CPU Message-ID: <20180514191551.GA27939@bombadil.infradead.org> References: <0efb5547-9250-6b6c-fe8e-cf4f44aaa5eb@netapp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0efb5547-9250-6b6c-fe8e-cf4f44aaa5eb@netapp.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 14, 2018 at 08:28:01PM +0300, Boaz Harrosh wrote: > On a call to mmap an mmap provider (like an FS) can put > this flag on vma->vm_flags. > > The VM_LOCAL_CPU flag tells the Kernel that the vma will be used > from a single-core only, and therefore invalidation (flush_tlb) of > PTE(s) need not be a wide CPU scheduling. I still don't get this. You're opening the kernel up to being exploited by any application which can persuade it to set this flag on a VMA. > NOTE: This vma (VM_LOCAL_CPU) is never used during a page_fault. It is > always used in a synchronous way from a thread pinned to a single core. It's not a question of how your app is going to use this flag. It's a question about how another app can abuse this flag (or how your app is going to be exploited to abuse this flag) to break into the kernel.