LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "davem@davemloft.net" <davem@davemloft.net>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"mroos@linux.ee" <mroos@linux.ee>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"namit@vmware.com" <namit@vmware.com>,
	"luto@kernel.org" <luto@kernel.org>,
	"bp@alien8.de" <bp@alien8.de>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Hansen, Dave" <dave.hansen@intel.com>,
	"sparclinux@vger.kernel.org" <sparclinux@vger.kernel.org>
Subject: Re: [PATCH v2] vmalloc: Fix issues with flush flag
Date: Tue, 21 May 2019 01:59:54 +0000	[thread overview]
Message-ID: <339ef85d984f329aa66f29fa80781624e6e4aecc.camel@intel.com> (raw)
In-Reply-To: <20190520.184336.743103388474716249.davem@davemloft.net>

On Mon, 2019-05-20 at 18:43 -0700, David Miller wrote:
> From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
> Date: Tue, 21 May 2019 01:20:33 +0000
> 
> > Should it handle executing an unmapped page gracefully? Because
> > this
> > change is causing that to happen much earlier. If something was
> > relying
> > on a cached translation to execute something it could find the
> > mapping
> > disappear.
> 
> Does this work by not mapping any kernel mappings at the beginning,
> and then filling in the BPF mappings in response to faults?
No, nothing too fancy. It just flushes the vm mapping immediatly in
vfree for execute (and RO) mappings. The only thing that happens around
allocation time is setting of a new flag to tell vmalloc to do the
flush.

The problem before was that the pages would be freed before the execute
mapping was flushed. So then when the pages got recycled, random,
sometimes coming from userspace, data would be mapped as executable in
the kernel by the un-flushed tlb entries.



  reply	other threads:[~2019-05-21  1:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-20 20:07 Rick Edgecombe
2019-05-20 21:25 ` Andy Lutomirski
2019-05-20 21:48   ` Edgecombe, Rick P
2019-05-20 21:36 ` Meelis Roos
2019-05-20 22:17   ` Edgecombe, Rick P
2019-05-20 22:48     ` David Miller
2019-05-21  0:20       ` Edgecombe, Rick P
2019-05-21  0:33         ` David Miller
2019-05-21  1:20           ` Edgecombe, Rick P
2019-05-21  1:43             ` David Miller
2019-05-21  1:59               ` Edgecombe, Rick P [this message]
2019-05-22 17:40                 ` David Miller
2019-05-22 19:26                   ` Edgecombe, Rick P
2019-05-22 22:40                     ` Edgecombe, Rick P
2019-05-24 15:50                       ` Edgecombe, Rick P

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=339ef85d984f329aa66f29fa80781624e6e4aecc.camel@intel.com \
    --to=rick.p.edgecombe@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=mroos@linux.ee \
    --cc=namit@vmware.com \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=sparclinux@vger.kernel.org \
    --subject='Re: [PATCH v2] vmalloc: Fix issues with flush flag' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).