Thread (222 messages) flat view 222 messages, 21 authors, 2022-11-03

Re: [PATCH v2 22/39] mm: Don't allow write GUPs to shadow stack memory

From: Dave Hansen <hidden>
Date: 2022-09-30 19:16:57
Also in: linux-arch, linux-doc, linux-mm, lkml

On 9/29/22 15:29, Rick Edgecombe wrote:
quoted hunk ↗ jump to hunk
@@ -1633,6 +1633,9 @@ static inline bool __pte_access_permitted(unsigned long pteval, bool write)
 {
 	unsigned long need_pte_bits = _PAGE_PRESENT|_PAGE_USER;
 
+	if (write && (pteval & (_PAGE_RW | _PAGE_DIRTY)) == _PAGE_DIRTY)
+		return 0;
Do we not have a helper for this?  Seems a bit messy to open-code these
shadow-stack permissions.  Definitely at least needs a comment.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help