Re: [PATCH v3 2/2] drm: protect drm_master pointers in drm_lease.c

2021-06-23 Thread Daniel Vetter
On Wed, Jun 23, 2021 at 5:49 AM Desmond Cheong Zhi Xi wrote: > > On 21/6/21 10:47 pm, Daniel Vetter wrote: > > On Sun, Jun 20, 2021 at 07:03:27PM +0800, Desmond Cheong Zhi Xi wrote: > >> diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c > >> index 86d4b72e95cb..0c64a77c67a6 1006

Re: [PATCH v3 2/2] drm: protect drm_master pointers in drm_lease.c

2021-06-22 Thread Desmond Cheong Zhi Xi
On 21/6/21 10:47 pm, Daniel Vetter wrote: On Sun, Jun 20, 2021 at 07:03:27PM +0800, Desmond Cheong Zhi Xi wrote: diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c index 86d4b72e95cb..0c64a77c67a6 100644 --- a/drivers/gpu/drm/drm_auth.c +++ b/drivers/gpu/drm/drm_auth.c @@ -384,

Re: [PATCH v3 2/2] drm: protect drm_master pointers in drm_lease.c

2021-06-21 Thread Daniel Vetter
On Sun, Jun 20, 2021 at 07:03:27PM +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

[PATCH v3 2/2] drm: protect drm_master pointers in drm_lease.c

2021-06-20 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