Re: [igt-dev] [PATCH i-g-t] i915/gem_userptr_blits: Check for allowed GTT mmaps

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

 



Quoting Tvrtko Ursulin (2019-10-02 09:42:01)
> 
> On 01/10/2019 18:49, Chris Wilson wrote:
> > @@ -1225,7 +1247,7 @@ static void test_readonly_mmap(int i915)
> >       original = g_compute_checksum_for_data(G_CHECKSUM_SHA1, pages, sz);
> >   
> >       ptr = __gem_mmap__gtt(i915, handle, sz, PROT_WRITE);
> > -     igt_assert(ptr == NULL);
> > +     igt_require(ptr != NULL);
> 
> This should be able to stay unchanged, no? Whether read-only or mmap_gtt 
> is disallowed it must always be NULL here. Non-NULL should be test fail.

The test is also checking that readonly is honoured through the GTT mmap
interface, i.e. that you cannot write into imported memory, thereby
circumventing userptr(mmap("/etc/passwd", PROT_READ)).

I stuck the require in the wrong spot...
-Chris
_______________________________________________
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