* [Intel-gfx] [PATCH i-g-t] i915/gem_caching: Fix mmap protection for writes
@ 2020-08-06 18:31 Chris Wilson
2020-08-06 19:10 ` Ramalingam C
2020-08-07 8:04 ` Grzegorzek, Dominik
0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2020-08-06 18:31 UTC (permalink / raw)
To: intel-gfx; +Cc: igt-dev, Dominik Grzegorzek, Chris Wilson
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>
---
tests/i915/gem_caching.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/i915/gem_caching.c b/tests/i915/gem_caching.c
index 1d8989db7..894c4b12e 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);
--
2.28.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Intel-gfx] [PATCH i-g-t] i915/gem_caching: Fix mmap protection for writes
2020-08-06 18:31 [Intel-gfx] [PATCH i-g-t] i915/gem_caching: Fix mmap protection for writes Chris Wilson
@ 2020-08-06 19:10 ` Ramalingam C
2020-08-07 8:04 ` Grzegorzek, Dominik
1 sibling, 0 replies; 3+ messages in thread
From: Ramalingam C @ 2020-08-06 19:10 UTC (permalink / raw)
To: Chris Wilson; +Cc: igt-dev, intel-gfx, Dominik Grzegorzek
On 2020-08-06 at 19:31:43 +0100, Chris Wilson wrote:
> 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>
Reviewed-by: Ramalingam C <ramalingam.c@intel.com>
> Cc: Ramalingam C <ramalingam.c@intel.com>
> Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
> ---
> tests/i915/gem_caching.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/i915/gem_caching.c b/tests/i915/gem_caching.c
> index 1d8989db7..894c4b12e 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);
>
> --
> 2.28.0
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Intel-gfx] [PATCH i-g-t] i915/gem_caching: Fix mmap protection for writes
2020-08-06 18:31 [Intel-gfx] [PATCH i-g-t] i915/gem_caching: Fix mmap protection for writes Chris Wilson
2020-08-06 19:10 ` Ramalingam C
@ 2020-08-07 8:04 ` Grzegorzek, Dominik
1 sibling, 0 replies; 3+ messages in thread
From: Grzegorzek, Dominik @ 2020-08-07 8:04 UTC (permalink / raw)
To: intel-gfx, chris; +Cc: igt-dev
On Thu, 2020-08-06 at 19:31 +0100, Chris Wilson wrote:
> 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].
>
Thank you for fixing that.
> 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>
> ---
> tests/i915/gem_caching.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/i915/gem_caching.c b/tests/i915/gem_caching.c
> index 1d8989db7..894c4b12e 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);
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-07 8:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-06 18:31 [Intel-gfx] [PATCH i-g-t] i915/gem_caching: Fix mmap protection for writes Chris Wilson
2020-08-06 19:10 ` Ramalingam C
2020-08-07 8:04 ` Grzegorzek, Dominik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).