From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "namit@vmware.com" <namit@vmware.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"daniel@iogearbox.net" <daniel@iogearbox.net>,
"jeyu@kernel.org" <jeyu@kernel.org>,
"rostedt@goodmis.org" <rostedt@goodmis.org>,
"ast@kernel.org" <ast@kernel.org>,
"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"jannh@google.com" <jannh@google.com>,
"Dock, Deneen T" <deneen.t.dock@intel.com>,
"kristen@linux.intel.com" <kristen@linux.intel.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"will.deacon@arm.com" <will.deacon@arm.com>,
"mingo@redhat.com" <mingo@redhat.com>,
"luto@kernel.org" <luto@kernel.org>,
"kernel-hardening@lists.openwall.com"
<kernel-hardening@lists.openwall.com>,
"Keshavamurthy, Anil S" <anil.s.keshavamurthy@int
Subject: Re: [PATCH v2 4/4] x86/vmalloc: Add TLB efficient x86 arch_vunmap
Date: Wed, 12 Dec 2018 21:05:52 +0000 [thread overview]
Message-ID: <2604df8fb817d8f0c38f572f4fb184db36554bed.camel@intel.com> (raw)
In-Reply-To: <90B10050-0CF1-48B2-B671-508FB092C2FE@vmware.com>
On Wed, 2018-12-12 at 06:30 +0000, Nadav Amit wrote:
> > On Dec 11, 2018, at 4:03 PM, Rick Edgecombe <rick.p.edgecombe@intel.com>
> > wrote:
> >
> > This adds a more efficient x86 architecture specific implementation of
> > arch_vunmap, that can free any type of special permission memory with only 1
> > TLB
> > flush.
> >
> > In order to enable this, _set_pages_p and _set_pages_np are made non-static
> > and
> > renamed set_pages_p_noflush and set_pages_np_noflush to better communicate
> > their different (non-flushing) behavior from the rest of the set_pages_*
> > functions.
> >
> > The method for doing this with only 1 TLB flush was suggested by Andy
> > Lutomirski.
> >
>
> [snip]
>
> > + /*
> > + * If the vm being freed has security sensitive capabilities such as
> > + * executable we need to make sure there is no W window on the directmap
> > + * before removing the X in the TLB. So we set not present first so we
> > + * can flush without any other CPU picking up the mapping. Then we reset
> > + * RW+P without a flush, since NP prevented it from being cached by
> > + * other cpus.
> > + */
> > + set_area_direct_np(area);
> > + vm_unmap_aliases();
>
> Does vm_unmap_aliases() flush in the TLB the direct mapping range as well? I
> can only find the flush of the vmalloc range.
Hmmm. It should usually (I tested), but now I wonder if there are cases where it
doesn't and it could depend on architecture as well. I'll have to trace through
this to verify, thanks.
Rick
next prev parent reply other threads:[~2018-12-12 21:05 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-12 0:03 [PATCH v2 0/4] Don’t leave executable TLB entries to freed pages Rick Edgecombe
2018-12-12 0:03 ` [PATCH v2 1/4] vmalloc: New flags for safe vfree on special perms Rick Edgecombe
2018-12-12 2:20 ` Andy Lutomirski
2018-12-12 19:50 ` Edgecombe, Rick P
2018-12-12 19:57 ` Andy Lutomirski
2018-12-12 22:01 ` Edgecombe, Rick P
2018-12-15 18:52 ` Andy Lutomirski
2018-12-18 0:23 ` Edgecombe, Rick P
2018-12-18 1:02 ` Andy Lutomirski
2018-12-21 16:39 ` Ard Biesheuvel
2018-12-21 17:12 ` Andy Lutomirski
2018-12-21 17:25 ` Ard Biesheuvel
2018-12-21 19:57 ` Edgecombe, Rick P
2018-12-22 11:12 ` Ard Biesheuvel
2018-12-12 0:03 ` [PATCH v2 2/4] modules: Add new special vfree flags Rick Edgecombe
2018-12-12 23:40 ` Nadav Amit
2018-12-13 19:02 ` Edgecombe, Rick P
2018-12-13 19:27 ` Nadav Amit
2018-12-13 21:48 ` Edgecombe, Rick P
2018-12-12 0:03 ` [PATCH v2 3/4] bpf: switch to new vmalloc " Rick Edgecombe
2018-12-12 0:03 ` [PATCH v2 4/4] x86/vmalloc: Add TLB efficient x86 arch_vunmap Rick Edgecombe
2018-12-12 2:24 ` Andy Lutomirski
2018-12-12 19:51 ` Edgecombe, Rick P
2018-12-12 6:30 ` Nadav Amit
2018-12-12 21:05 ` Edgecombe, Rick P [this message]
2018-12-12 21:16 ` Nadav Amit
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=2604df8fb817d8f0c38f572f4fb184db36554bed.camel@intel.com \
--to=rick.p.edgecombe@intel.com \
--cc=akpm@linux-foundation.org \
--cc=anil.s.keshavamurthy@int \
--cc=ard.biesheuvel@linaro.org \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=deneen.t.dock@intel.com \
--cc=jannh@google.com \
--cc=jeyu@kernel.org \
--cc=kernel-hardening@lists.openwall.com \
--cc=kristen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=namit@vmware.com \
--cc=rostedt@goodmis.org \
--cc=will.deacon@arm.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).