Thread (123 messages) 123 messages, 12 authors, 2018-08-14

Re: [RFC PATCH v2 14/27] mm: Handle THP/HugeTLB shadow stack page fault

From: Dave Hansen <dave.hansen@linux.intel.com>
Date: 2018-07-10 23:08:36
Also in: linux-api, linux-doc, linux-mm, lkml

On 07/10/2018 03:26 PM, Yu-cheng Yu wrote:
quoted hunk ↗ jump to hunk
@@ -1347,6 +1353,8 @@ int do_huge_pmd_wp_page(struct vm_fault *vmf, pmd_t orig_pmd)
 		pmd_t entry;
 		entry = mk_huge_pmd(new_page, vma->vm_page_prot);
 		entry = maybe_pmd_mkwrite(pmd_mkdirty(entry), vma);
+		if (is_shstk_mapping(vma->vm_flags))
+			entry = pmd_mkdirty_shstk(entry);
This pattern is repeated enough that it makes me wonder if we should
just be doing the shadowstack PTE creation in mk_huge_pmd() itself.

Or, should we just be setting the shadowstack pte bit combination in
vma->vm_page_prot so we don't have to go set it explicitly every time?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help