Re: [Intel-gfx] [PATCH v5 3/3] drm: protect drm_master pointers in drm_lease.c

2021-06-30 Thread Desmond Cheong Zhi Xi
On 30/6/21 4:02 pm, Daniel Vetter wrote: On Wed, Jun 30, 2021 at 9:18 AM Desmond Cheong Zhi Xi wrote: On 30/6/21 12:07 am, Daniel Vetter wrote: On Tue, Jun 29, 2021 at 11:37:06AM +0800, Desmond Cheong Zhi Xi wrote: Currently, direct copies of drm_file->master pointers should be protected by

Re: [Intel-gfx] [PATCH v5 3/3] drm: protect drm_master pointers in drm_lease.c

2021-06-30 Thread Desmond Cheong Zhi Xi
On 30/6/21 12:07 am, Daniel Vetter wrote: On Tue, Jun 29, 2021 at 11:37:06AM +0800, Desmond Cheong Zhi Xi wrote: Currently, direct copies of drm_file->master pointers should be protected by drm_device.master_mutex when being dereferenced. This is because drm_file->master is not invariant for the

Re: [Intel-gfx] [PATCH v5 3/3] drm: protect drm_master pointers in drm_lease.c

2021-06-30 Thread Desmond Cheong Zhi Xi
On 30/6/21 8:16 am, Emil Velikov wrote: Hi Desmond, Couple of small suggestions, with those the series is: Reviewed-by: Emil Velikov On Tue, 29 Jun 2021 at 04:38, Desmond Cheong Zhi Xi wrote: @@ -128,13 +137,20 @@ bool drm_lease_held(struct drm_file *file_priv, int id) struct drm_m

Re: [Intel-gfx] [PATCH v5 3/3] drm: protect drm_master pointers in drm_lease.c

2021-06-30 Thread Daniel Vetter
On Wed, Jun 30, 2021 at 9:18 AM Desmond Cheong Zhi Xi wrote: > > On 30/6/21 12:07 am, Daniel Vetter wrote: > > On Tue, Jun 29, 2021 at 11:37:06AM +0800, Desmond Cheong Zhi Xi wrote: > >> Currently, direct copies of drm_file->master pointers should be > >> protected by drm_device.master_mutex when

Re: [Intel-gfx] [PATCH v5 3/3] drm: protect drm_master pointers in drm_lease.c

2021-06-29 Thread Emil Velikov
Hi Desmond, Couple of small suggestions, with those the series is: Reviewed-by: Emil Velikov On Tue, 29 Jun 2021 at 04:38, Desmond Cheong Zhi Xi wrote: > @@ -128,13 +137,20 @@ bool drm_lease_held(struct drm_file *file_priv, int id) > struct drm_master *master; > bool ret; > > -

Re: [Intel-gfx] [PATCH v5 3/3] drm: protect drm_master pointers in drm_lease.c

2021-06-29 Thread Daniel Vetter
On Tue, Jun 29, 2021 at 11:37:06AM +0800, Desmond Cheong Zhi Xi wrote: > Currently, direct copies of drm_file->master pointers should be > protected by drm_device.master_mutex when being dereferenced. This is > because drm_file->master is not invariant for the lifetime of > drm_file. If drm_file is

[Intel-gfx] [PATCH v5 3/3] drm: protect drm_master pointers in drm_lease.c

2021-06-29 Thread Desmond Cheong Zhi Xi
Currently, direct copies of drm_file->master pointers should be protected by drm_device.master_mutex when being dereferenced. This is because drm_file->master is not invariant for the lifetime of drm_file. If drm_file is not the creator of master, then drm_file->is_master is false, and a call to dr