mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-12 20:35:23 +02: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:
parent
2c5e07cea3
commit
dd9c02ccfe
|
@ -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 */
|
||||
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 */
|
||||
vm_flags_clear(pad, VM_READ|VM_WRITE|VM_EXEC);
|
||||
|
||||
__vm_flags_mod(pad, 0, VM_READ|VM_WRITE|VM_EXEC);
|
||||
/* Remove padding bits */
|
||||
vm_flags_clear(pad, VM_PAD_MASK);
|
||||
__vm_flags_mod(pad, 0, VM_PAD_MASK);
|
||||
|
||||
return pad;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user