[PATCH i-g-t 2/2] i915/gem_mmap_offset: Relax isolation rules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It is legal for mmap_offset_ioctl to return the same offset for
different clients, so long as that offset is only valid for use with the
client's fd and no one elses.

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
---
 tests/i915/gem_mmap_offset.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
index c3b85d29e..83e9890a5 100644
--- a/tests/i915/gem_mmap_offset.c
+++ b/tests/i915/gem_mmap_offset.c
@@ -233,15 +233,17 @@ static void isolation(int i915)
 		igt_assert(ptr == MAP_FAILED);
 		igt_assert_eq(errno, EACCES);
 
-		errno = 0;
-		ptr = mmap64(0, 4096, PROT_READ, MAP_SHARED, B, offset_a);
-		igt_assert(ptr == MAP_FAILED);
-		igt_assert_eq(errno, EACCES);
-
-		errno = 0;
-		ptr = mmap64(0, 4096, PROT_READ, MAP_SHARED, A, offset_b);
-		igt_assert(ptr == MAP_FAILED);
-		igt_assert_eq(errno, EACCES);
+		if (offset_a != offset_b) {
+			errno = 0;
+			ptr = mmap(0, 4096, PROT_READ, MAP_SHARED, B, offset_a);
+			igt_assert(ptr == MAP_FAILED);
+			igt_assert_eq(errno, EACCES);
+
+			errno = 0;
+			ptr = mmap(0, 4096, PROT_READ, MAP_SHARED, A, offset_b);
+			igt_assert(ptr == MAP_FAILED);
+			igt_assert_eq(errno, EACCES);
+		}
 
 		close(B);
 
-- 
2.25.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux