Re: [PATCH v7 2/2] drm: Prevent release fb after cleanup drm_mode_config

2017-04-12 Thread jeffy
Hi Daniel, On 04/12/2017 02:36 PM, Daniel Vetter wrote: On Tue, Apr 11, 2017 at 11:31:42AM +0800, Jeffy Chen wrote: We are freeing all framebuffers in drm_mode_config_cleanup without sync the drm_file's fbs list. So if someone try to unbind drm before release drm dev fd, the fbs list would rem

Re: [PATCH v7 2/2] drm: Prevent release fb after cleanup drm_mode_config

2017-04-11 Thread Daniel Vetter
On Tue, Apr 11, 2017 at 11:31:42AM +0800, Jeffy Chen wrote: > We are freeing all framebuffers in drm_mode_config_cleanup without > sync the drm_file's fbs list. > > So if someone try to unbind drm before release drm dev fd, the fbs > list would remain some invalid fb references. And that would cau

[PATCH v7 2/2] drm: Prevent release fb after cleanup drm_mode_config

2017-04-11 Thread Jeffy Chen
We are freeing all framebuffers in drm_mode_config_cleanup without sync the drm_file's fbs list. So if someone try to unbind drm before release drm dev fd, the fbs list would remain some invalid fb references. And that would cause crash later in drm_fb_release. Add a sanity check to prevent that.