Re: [Intel-gfx] [PATCH 1/2] drm: avoid races with modesetting rights

2021-08-16 Thread Desmond Cheong Zhi Xi
On 13/8/21 11:49 pm, Daniel Vetter wrote: On Fri, Aug 13, 2021 at 04:54:49PM +0800, Desmond Cheong Zhi Xi wrote: In drm_client_modeset.c and drm_fb_helper.c, drm_master_internal_{acquire,release} are used to avoid races with DRM userspace. These functions hold onto drm_device.master_mutex while

Re: [Intel-gfx] [PATCH 1/2] drm: avoid races with modesetting rights

2021-08-13 Thread Daniel Vetter
On Fri, Aug 13, 2021 at 04:54:49PM +0800, Desmond Cheong Zhi Xi wrote: > In drm_client_modeset.c and drm_fb_helper.c, > drm_master_internal_{acquire,release} are used to avoid races with DRM > userspace. These functions hold onto drm_device.master_mutex while > committing, and bail if there's alrea

[Intel-gfx] [PATCH 1/2] drm: avoid races with modesetting rights

2021-08-13 Thread Desmond Cheong Zhi Xi
In drm_client_modeset.c and drm_fb_helper.c, drm_master_internal_{acquire,release} are used to avoid races with DRM userspace. These functions hold onto drm_device.master_mutex while committing, and bail if there's already a master. However, ioctls can still race between themselves. A time-of-chec