Re: [PATCH v26 29/30] mm: Update arch_validate_flags() to test vma anonymous

From
Kirill A. Shutemov <hidden>
Date
2021-05-11 11:35:43
Also in
linux-api, linux-arch, linux-mm, lkml
Reply to
Yu-cheng Yu, 2021-04-27
On Tue, Apr 27, 2021 at 01:43:14PM -0700, Yu-cheng Yu wrote:
When newer VM flags are being created, such as VM_MTE, it becomes necessary
for mmap/mprotect to verify if certain flags are being applied to an
anonymous VMA.

To solve this, one approach is adding a VM flag to track that MAP_ANONYMOUS
is specified [1], and then using the flag in arch_validate_flags().

Another approach is passing the VMA to arch_validate_flags(), and check
vma_is_anonymous().

To prepare the introduction of PROT_SHADOW_STACK, which creates a shadow
stack mapping and can be applied only to an anonymous VMA, update
arch_validate_flags() to pass in the VMA.

[1] commit 9f3419315f3c ("arm64: mte: Add PROT_MTE support to mmap() and mprotect()"),

Signed-off-by: Yu-cheng Yu <redacted>
Reviewed-by: Kirill A. Shutemov <redacted>

-- 
 Kirill A. Shutemov
Thread (82 messages) 82 messages, 10 authors, last reply 2021-05-21
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help