Re: [PATCH v5 02/10] mm, x86: Add support for eXclusive Page Frame Ownership (XPFO)

2017-08-14 Thread Tycho Andersen
On Mon, Aug 14, 2017 at 09:47:18PM -0600, Tycho Andersen wrote: > I'll do that for the next version Actually looking closer, I think we just need to mirror the debug_pagealloc_enabled() checks in set_kpte() from split_large_page(), diff --git a/arch/x86/mm/xpfo.c b/arch/x86/mm/xpfo.c index a1344f

Re: [PATCH v5 02/10] mm, x86: Add support for eXclusive Page Frame Ownership (XPFO)

2017-08-14 Thread Tycho Andersen
Hi Laura, On Mon, Aug 14, 2017 at 03:30:00PM -0700, Laura Abbott wrote: > On 08/09/2017 01:07 PM, Tycho Andersen wrote: > > +/* Update a single kernel page table entry */ > > +inline void set_kpte(void *kaddr, struct page *page, pgprot_t prot) > > +{ > > + unsigned int level; > > + pgprot_t ms

Re: [PATCH v5 02/10] mm, x86: Add support for eXclusive Page Frame Ownership (XPFO)

2017-08-14 Thread Laura Abbott
On 08/09/2017 01:07 PM, Tycho Andersen wrote: +/* Update a single kernel page table entry */ +inline void set_kpte(void *kaddr, struct page *page, pgprot_t prot) +{ + unsigned int level; + pgprot_t msk_clr; + pte_t *pte = lookup_address((unsigned long)kaddr, &level); + + B

Re: [PATCH v5 02/10] mm, x86: Add support for eXclusive Page Frame Ownership (XPFO)

2017-08-14 Thread Laura Abbott
On 08/09/2017 01:07 PM, Tycho Andersen wrote: > diff --git a/mm/xpfo.c b/mm/xpfo.c > new file mode 100644 > index ..3cd45f68b5ad > --- /dev/null > +++ b/mm/xpfo.c > @@ -0,0 +1,208 @@ > +/* > + * Copyright (C) 2017 Hewlett Packard Enterprise Development, L.P. > + * Copyright (C) 2016 Bro

[PATCH v5 02/10] mm, x86: Add support for eXclusive Page Frame Ownership (XPFO)

2017-08-09 Thread Tycho Andersen
From: Juerg Haefliger This patch adds support for XPFO which protects against 'ret2dir' kernel attacks. The basic idea is to enforce exclusive ownership of page frames by either the kernel or userspace, unless explicitly requested by the kernel. Whenever a page destined for userspace is allocated