From: Andrzej Turko <andrzej.turko@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 1/2] lib/intel_allocator_simple: Check boundaries of reserved blocks
Date: Thu, 22 Jul 2021 10:24:25 +0200 [thread overview]
Message-ID: <20210722082426.4538-2-andrzej.turko@linux.intel.com> (raw)
In-Reply-To: <20210722082426.4538-1-andrzej.turko@linux.intel.com>
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>
---
lib/intel_allocator_simple.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/intel_allocator_simple.c b/lib/intel_allocator_simple.c
index 0e6763964..8d5105f11 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));
--
2.25.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2021-07-22 8:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-22 8:24 [igt-dev] [PATCH i-g-t 0/2] Check the addresses of blocks being reserved Andrzej Turko
2021-07-22 8:24 ` Andrzej Turko [this message]
2021-07-28 16:54 ` [igt-dev] [PATCH i-g-t 1/2] lib/intel_allocator_simple: Check boundaries of reserved blocks Zbigniew Kempczyński
2021-07-22 8:24 ` [igt-dev] [PATCH i-g-t 2/2] tests/i915/gem_softpin: Adjust the addresses of reverved blocks Andrzej Turko
2021-07-28 17:14 ` Zbigniew Kempczyński
2021-07-22 9:19 ` [igt-dev] ✓ Fi.CI.BAT: success for Check the addresses of blocks being reserved Patchwork
2021-07-22 11:29 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210722082426.4538-2-andrzej.turko@linux.intel.com \
--to=andrzej.turko@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox