summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-08-06 19:28:00 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-08-06 20:30:44 +0100
commitdb2413ccbf6c36bea4066e2a7254897779c22b89 (patch)
tree8aa13dd22fbf78499ea4e70d75f1a16e2aaf41e7
parentec3d9a843686a618612016de9249117dd8d862a8 (diff)
i915/gem_caching: Fix mmap protection for writes
As we are about to write into the mmap'ed pointer using memset, we need to specify PROT_WRITE [if we only say PROT_READ, then the memset should generate a SIGSEGV]. Fixes: 897d21d14e99 ("i915/gem_caching: Remove libdrm dependency") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Ramalingam C <ramalingam.c@intel.com> Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com> Reviewed-by: Ramalingam C <ramalingam.c@intel.com>
-rw-r--r--tests/i915/gem_caching.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/i915/gem_caching.c b/tests/i915/gem_caching.c
index 1d8989db..894c4b12 100644
--- a/tests/i915/gem_caching.c
+++ b/tests/i915/gem_caching.c
@@ -282,7 +282,7 @@ igt_main
val2 = i + 63;
cpu_ptr = gem_mmap__cpu(data.fd, scratch_buf->handle,
0, scratch_buf->surface[0].size,
- PROT_READ);
+ PROT_WRITE);
memset(cpu_ptr + start, val2, len);