DivestOS/Patches/Linux_CVEs/CVE-2016-6728/ANY/2.patch
2017-10-29 22:14:37 -04:00

39 lines
1.4 KiB
Diff

From 6d907675d409feb2145add6aa7f905002a50e8ca Mon Sep 17 00:00:00 2001
From: Daniel Rosenberg <drosen@google.com>
Date: Fri, 9 Sep 2016 15:32:34 -0700
Subject: [PATCH] ion: Disable ION_HEAP_TYPE_SYSTEM_CONTIG
Bug: 30400942
Change-Id: I19fa5bf6e5c66b532b842180b2cf0ae04ddca337
Signed-off-by: Daniel Rosenberg <drosen@google.com>
---
drivers/staging/android/ion/ion_heap.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/android/ion/ion_heap.c b/drivers/staging/android/ion/ion_heap.c
index 0c62683ac0409..fa6c9daf8eec9 100644
--- a/drivers/staging/android/ion/ion_heap.c
+++ b/drivers/staging/android/ion/ion_heap.c
@@ -300,8 +300,9 @@ struct ion_heap *ion_heap_create(struct ion_platform_heap *heap_data)
switch (heap_data->type) {
case ION_HEAP_TYPE_SYSTEM_CONTIG:
- heap = ion_system_contig_heap_create(heap_data);
- break;
+ pr_err("%s: Heap type is disabled: %d\n", __func__,
+ heap_data->type);
+ return ERR_PTR(-EINVAL);
case ION_HEAP_TYPE_SYSTEM:
heap = ion_system_heap_create(heap_data);
break;
@@ -340,7 +341,8 @@ void ion_heap_destroy(struct ion_heap *heap)
switch (heap->type) {
case ION_HEAP_TYPE_SYSTEM_CONTIG:
- ion_system_contig_heap_destroy(heap);
+ pr_err("%s: Heap type is disabled: %d\n", __func__,
+ heap->type);
break;
case ION_HEAP_TYPE_SYSTEM:
ion_system_heap_destroy(heap);