mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 23:24:22 -04:00
ion: Forbid multi-VMID allocation requests for the secure system heap
The secure system heap does not support multi-VMID allocations, so do not allow them. Also, fortify the secure allocation check for the system heap allocation path. Change-Id: I51d53274c2374632db778461ba7505de4d723439 Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
This commit is contained in:
parent
dcdd5691d9
commit
90e8284897
2 changed files with 3 additions and 2 deletions
|
|
@ -288,7 +288,7 @@ static int ion_system_heap_allocate(struct ion_heap *heap,
|
|||
return -ENOMEM;
|
||||
|
||||
if (ion_heap_is_system_heap_type(buffer->heap->type) &&
|
||||
is_secure_vmid_valid(vmid)) {
|
||||
is_secure_allocation(buffer->flags)) {
|
||||
pr_info("%s: System heap doesn't support secure allocations\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -79,9 +79,10 @@ static int ion_system_secure_heap_allocate(struct ion_heap *heap,
|
|||
struct ion_system_secure_heap *secure_heap =
|
||||
to_system_secure_heap(heap);
|
||||
enum ion_heap_type type = secure_heap->heap.ion_heap.type;
|
||||
unsigned long cp_flags = buffer->flags & ION_FLAGS_CP_MASK;
|
||||
|
||||
if (!ion_heap_is_system_secure_heap_type(type) ||
|
||||
!is_cp_flag_present(flags)) {
|
||||
!is_cp_flag_present(flags) || (hweight_long(cp_flags) != 1)) {
|
||||
pr_info("%s: Incorrect heap type or incorrect flags\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue