Thread (79 messages) 79 messages, 10 authors, 2018-11-14
STALE2811d
Revisions (3)
  1. v3 [diff vs current]
  2. v4 [diff vs current]
  3. v5 current

[PATCH v5 10/27] mm/mmap: Prevent Shadow Stack VMA merges

From: Yu-cheng Yu <hidden>
Date: 2018-10-11 15:24:29
Also in: linux-arch, linux-doc, linux-mm, lkml
Subsystem: memory management, memory mapping, the rest · Maintainers: Andrew Morton, Liam R. Howlett, Lorenzo Stoakes, Linus Torvalds

To prevent function call/return spills into the next shadow stack
area, we do not merge shadow stack areas.

Signed-off-by: Yu-cheng Yu <redacted>
---
 mm/mmap.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/mm/mmap.c b/mm/mmap.c
index 5f2b2b184c60..b85292014ec9 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1123,6 +1123,12 @@ struct vm_area_struct *vma_merge(struct mm_struct *mm,
 	if (vm_flags & VM_SPECIAL)
 		return NULL;
 
+	/*
+	 * Do not merge shadow stack areas.
+	 */
+	if (vm_flags & VM_SHSTK)
+		return NULL;
+
 	if (prev)
 		next = prev->vm_next;
 	else
-- 
2.17.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help