Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef1c80bc authored by Liam Mark's avatar Liam Mark Committed by Patrick Daly
Browse files

ion: disable system contig heap



A malicious application can take advantage of the ION contig heap to
create a specific memory chunk size to exercise a rowhammer attack on the
physical hardware.
So remove support for the ION contig heap.

Change-Id: I9cb454cebb74df291479cecc3533d2c684363f77
Signed-off-by: default avatarLiam Mark <lmark@codeaurora.org>
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent 1473aa42
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -325,8 +325,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;
@@ -366,7 +367,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);