Re: [PATCH 1/2] drm/etnaviv: Use FOLL_FORCE for userptr

2021-03-19 Thread Lucas Stach
Am Freitag, dem 19.03.2021 um 20:09 +0100 schrieb Daniel Vetter: > On Mon, Mar 01, 2021 at 10:52:53AM +0100, Daniel Vetter wrote: > > Nothing checks userptr.ro except this call to pup_fast, which means > > there's nothing actually preventing userspace from writing to this. > > Which means you can j

Re: [PATCH 1/2] drm/etnaviv: Use FOLL_FORCE for userptr

2021-03-19 Thread Daniel Vetter
On Mon, Mar 01, 2021 at 10:52:53AM +0100, Daniel Vetter wrote: > Nothing checks userptr.ro except this call to pup_fast, which means > there's nothing actually preventing userspace from writing to this. > Which means you can just read-only mmap any file you want, userptr it > and then write to it w

Re: [PATCH 1/2] drm/etnaviv: Use FOLL_FORCE for userptr

2021-03-01 Thread Daniel Vetter
On Mon, Mar 1, 2021 at 11:28 AM Lucas Stach wrote: > > Am Montag, dem 01.03.2021 um 10:52 +0100 schrieb Daniel Vetter: > > Nothing checks userptr.ro except this call to pup_fast, which means > > there's nothing actually preventing userspace from writing to this. > > Which means you can just read-o

Re: [PATCH 1/2] drm/etnaviv: Use FOLL_FORCE for userptr

2021-03-01 Thread Lucas Stach
Am Montag, dem 01.03.2021 um 10:52 +0100 schrieb Daniel Vetter: > Nothing checks userptr.ro except this call to pup_fast, which means > there's nothing actually preventing userspace from writing to this. > Which means you can just read-only mmap any file you want, userptr it > and then write to it

[PATCH 1/2] drm/etnaviv: Use FOLL_FORCE for userptr

2021-03-01 Thread Daniel Vetter
Nothing checks userptr.ro except this call to pup_fast, which means there's nothing actually preventing userspace from writing to this. Which means you can just read-only mmap any file you want, userptr it and then write to it with the gpu. Not good. The right way to handle this is FOLL_WRITE | FO