summaryrefslogtreecommitdiff
path: root/lib/intel_allocator_simple.c
diff options
context:
space:
mode:
authorAndrzej Turko <andrzej.turko@linux.intel.com>2021-07-22 10:24:25 +0200
committerZbigniew Kempczyński <zbigniew.kempczynski@intel.com>2021-07-28 19:16:50 +0200
commita75355ad2928d9e73a058a790d9a0f03d86ad73d (patch)
tree7b64d9d369b2846aaa371fdb791c6664cd0aa40b /lib/intel_allocator_simple.c
parenta5dffe7499a2f7189718ddf1ccf49060b7c1529d (diff)
lib/intel_allocator_simple: Check boundaries of reserved blocks
Make sure that reserved blocks fit in the address space managed by the simple allocator. Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Diffstat (limited to 'lib/intel_allocator_simple.c')
-rw-r--r--lib/intel_allocator_simple.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/intel_allocator_simple.c b/lib/intel_allocator_simple.c
index 0e676396..8d5105f1 100644
--- a/lib/intel_allocator_simple.c
+++ b/lib/intel_allocator_simple.c
@@ -523,6 +523,8 @@ static bool intel_allocator_simple_reserve(struct intel_allocator *ial,
end = DECANONICAL(end);
igt_assert(end > start || end == 0);
size = get_size(start, end);
+ igt_assert(start + size <= ials->end);
+ igt_assert(start >= ials->start);
if (simple_vma_heap_alloc_addr(ials, start, size)) {
rec = malloc(sizeof(*rec));