Thread (44 messages) flat view 44 messages, 3 authors, 2021-03-08

Re: [PATCH v21 10/26] x86/mm: Update pte_modify for _PAGE_COW

From: Borislav Petkov <bp@alien8.de>
Date: 2021-03-05 14:30:28
Also in: linux-api, linux-arch, linux-mm, lkml

On Wed, Feb 17, 2021 at 02:27:14PM -0800, Yu-cheng Yu wrote:
quoted hunk ↗ jump to hunk
@@ -787,16 +802,34 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
 	 */
 	val &= _PAGE_CHG_MASK;
 	val |= check_pgprot(newprot) & ~_PAGE_CHG_MASK;
+	val = fixup_dirty_pte(val);
Do I see it correctly that you can do here and below:

	/*
	 * Fix up potential shadow stack page flags because the RO, Dirty PTE is
	 * special.
	 */
	if (pte_dirty()) {
		pte_mkclean();
		pte_mkdirty();
	}

?

That fixup thing looks grafted and not like a normal flow to me.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help