mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
ANDROID: 16K: Avoid mmap lock assertions for padding VMAs
The padding VMA is never inserted into the VMA tree; therefore we
don't need to have the mmap lock in exclusive mode to modify it.
Test: v2/android-gki/ack_platform_integration_main_cf_arm64_boot_test
on kernel_virt_debug_aarch64
Bug: 346741763
Change-Id: I4ca3ed22dab45b6bb895cb41c5c6792344188b61
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
This commit is contained in:
committed by
Treehugger Robot
parent
caa8ffe476
commit
a8b3ebe7f9
@@ -294,11 +294,14 @@ struct vm_area_struct *get_pad_vma(struct vm_area_struct *vma)
|
|||||||
/* Adjust the start to begin at the start of the padding section */
|
/* Adjust the start to begin at the start of the padding section */
|
||||||
pad->vm_start = VMA_PAD_START(pad);
|
pad->vm_start = VMA_PAD_START(pad);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The below modifications to vm_flags don't need mmap write lock,
|
||||||
|
* since, pad does not belong to the VMA tree.
|
||||||
|
*/
|
||||||
/* Make the pad vma PROT_NONE */
|
/* Make the pad vma PROT_NONE */
|
||||||
vm_flags_clear(pad, VM_READ|VM_WRITE|VM_EXEC);
|
__vm_flags_mod(pad, 0, VM_READ|VM_WRITE|VM_EXEC);
|
||||||
|
|
||||||
/* Remove padding bits */
|
/* Remove padding bits */
|
||||||
vm_flags_clear(pad, VM_PAD_MASK);
|
__vm_flags_mod(pad, 0, VM_PAD_MASK);
|
||||||
|
|
||||||
return pad;
|
return pad;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user