[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3c34b566afb814ae40665916a0834cdd52d548a2.camel@intel.com>
Date: Tue, 12 Feb 2019 00:01:37 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "luto@...nel.org" <luto@...nel.org>, "bp@...en8.de" <bp@...en8.de>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"peterz@...radead.org" <peterz@...radead.org>,
"linux-integrity@...r.kernel.org" <linux-integrity@...r.kernel.org>,
"ard.biesheuvel@...aro.org" <ard.biesheuvel@...aro.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"nadav.amit@...il.com" <nadav.amit@...il.com>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"Dock, Deneen T" <deneen.t.dock@...el.com>,
"linux-security-module@...r.kernel.org"
<linux-security-module@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"hpa@...or.com" <hpa@...or.com>,
"kristen@...ux.intel.com" <kristen@...ux.intel.com>,
"mingo@...hat.com" <mingo@...hat.com>,
"linux_dti@...oud.com" <linux_dti@...oud.com>,
"will.deacon@....com" <will.deacon@....com>,
"kernel-hardening@...ts.openwall.com"
<kernel-hardening@...ts.openwall.com>
Subject: Re: [PATCH v2 13/20] Add set_alias_ function and x86 implementation
On Mon, 2019-02-11 at 14:59 -0800, Andy Lutomirski wrote:
> On Mon, Feb 11, 2019 at 11:09 AM Borislav Petkov <bp@...en8.de> wrote:
> >
> > On Mon, Jan 28, 2019 at 04:34:15PM -0800, Rick Edgecombe wrote:
> > > This adds two new functions set_alias_default_noflush and
> >
> > s/This adds/Add/
> >
> > > set_alias_nv_noflush for setting the alias mapping for the page to its
> >
> > Please end function names with parentheses, below too.
> >
> > > default valid permissions and to an invalid state that cannot be cached in
> > > a TLB, respectively. These functions to not flush the TLB.
> >
> > s/to/do/
> >
> > Also, pls put that description as comments over the functions in the
> > code. Otherwise that "nv" as part of the name doesn't really explain
> > what it does.
> >
> > Actually, you could just as well call the function
> >
> > set_alias_invalid_noflush()
> >
> > All the other words are written in full, no need to have "nv" there.
>
> Why are you calling this an "alias"? You're modifying the direct map.
> Your patches are thinking of the direct map as an alias of the vmap
> mapping, but that does seem a bit backwards. How about
> set_direct_map_invalid_noflush(), etc?
>
I picked it up from some of the names in arch/x86/mm/pageattr.c:
CPA_NO_CHECK_ALIAS, set_memory_np_noalias(), etc. In that file the directmap
address seems to be the "alias". For 32 bit with highmem though, this would also
set permissions for a kmap mapping as well (if one existed), since that address
will be returned from page_address().
Yea, in vmalloc, vm_unmap_aliases talks about the vmap address "alias". So I
guess calling it "alias" is ambiguous. But does set_direct_map_invalid_noflush
make sense in the highmem case?
I couldn't think of any names that I loved, which is why I ran the
set_alias_*_noflush names by people in an earlier version, although looking back
only Ard chimed in on that. "set_direct_map_invalid_noflush" is fine with me if
nobody objects.
Thanks,
Rick
Powered by blists - more mailing lists