Re: WARNING in idr_destroy

2020-03-15 Thread Qiujun Huang
We need to get idr_mutex first for idr_alloc. diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c index b481cafdde28..aa72c8344ec7 100644 --- a/drivers/gpu/drm/drm_lease.c +++ b/drivers/gpu/drm/drm_lease.c @@ -420,6 +420,7 @@ static int fill_object_idr(struct drm_device *dev,

[PATCH RESEND] drm/lease: fix potential race in fill_object_idr

2020-03-16 Thread Qiujun Huang
We should hold idr_mutex for idr_alloc. Signed-off-by: Qiujun Huang --- drivers/gpu/drm/drm_lease.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c index b481caf..427ee21 100644 --- a/drivers/gpu/drm

[PATCH] drm/lease: fix WARNING in idr_destroy

2020-03-16 Thread Qiujun Huang
leases has been destroyed: drm_master_put ->drm_master_destroy ->idr_destroy so the "out_lessee" needn't to call idr_destroy again. Reported-and-tested-by: syzbot+05835159fe322770f...@syzkaller.appspotmail.com Signed-off-by: Qiujun Huang --- drivers/gp

[PATCH] drm/amd/powerplay: remove redundant check in smu_set_soft_freq_range

2020-03-17 Thread Qiujun Huang
min(max) is type of uint32_t, min < 0(max < 0) is never true. move it. Addressed-Coverity: ("Unsigned compared against 0") Signed-off-by: Qiujun Huang --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/amd/powerp

Re: [PATCH RESEND] drm/lease: fix potential race in fill_object_idr

2020-03-17 Thread Qiujun Huang
On Wed, Mar 18, 2020 at 1:02 AM Daniel Vetter wrote: > > On Mon, Mar 16, 2020 at 03:18:23PM +0800, Qiujun Huang wrote: > > We should hold idr_mutex for idr_alloc. > > > > Signed-off-by: Qiujun Huang > > I've not seen the first version of this anywhere in my in

Re: [PATCH] drm/lease: fix WARNING in idr_destroy

2020-03-17 Thread Qiujun Huang
On Wed, Mar 18, 2020 at 12:57 AM Daniel Vetter wrote: > > On Mon, Mar 16, 2020 at 11:36:08AM +0800, Qiujun Huang wrote: > > leases has been destroyed: > > drm_master_put > > ->drm_master_destroy > > ->idr_destroy > > > > so th

[PATCH v2] drm/lease: fix WARNING in idr_destroy

2020-03-18 Thread Qiujun Huang
drm_lease_create takes ownership of leases. And leases will be released by drm_master_put. drm_master_put ->drm_master_destroy ->idr_destroy So we needn't call idr_destroy again. Reported-and-tested-by: syzbot+05835159fe322770f...@syzkaller.appspotmail.com Signed-off

Re: WARNING in idr_destroy

2020-03-18 Thread Qiujun Huang
#syz test: https://github.com/hqj/hqjagain_test.git idr_destroy ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH RESEND] drm/lease: fix potential race in fill_object_idr

2020-03-19 Thread Qiujun Huang
On Wed, Mar 18, 2020 at 3:34 PM Daniel Vetter wrote: > > On Tue, Mar 17, 2020 at 11:33 PM Qiujun Huang wrote: > > > > On Wed, Mar 18, 2020 at 1:02 AM Daniel Vetter wrote: > > > > > > On Mon, Mar 16, 2020 at 03:18:23PM +0800, Qiujun Huang wrote: > >

Re: [PATCH] fbcon: fix null-ptr-deref in fbcon_switch

2020-03-30 Thread Qiujun Huang
On Sun, Mar 29, 2020 at 2:13 AM Sam Ravnborg wrote: > > Hi Qiujun > > Thanks for looking into the sysbot bugs. > > On Sat, Mar 28, 2020 at 11:15:10PM +0800, Qiujun Huang wrote: > > Add check for vc_cons[logo_shown].d, as it can be released by > > vt_ioctl(VT_DIS

[PATCH v2] fbcon: fix null-ptr-deref in fbcon_switch

2020-03-30 Thread Qiujun Huang
bot+732528bae351682f1...@syzkaller.appspotmail.com Signed-off-by: Qiujun Huang --- drivers/video/fbdev/core/fbcon.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index bb6ae995c2e5..5eb3fc90f9f6 100644 --- a/drivers/video/fb

Re: [PATCH] fbcon: fix null-ptr-deref in fbcon_switch

2020-03-30 Thread Qiujun Huang
On Sun, Mar 29, 2020 at 12:31 AM Daniel Vetter wrote: > > On Sat, Mar 28, 2020 at 4:15 PM Qiujun Huang wrote: > > Add check for vc_cons[logo_shown].d, as it can be released by > > vt_ioctl(VT_DISALLOCATE). > > Can you pls link to the syzbot report and distill the esse

[PATCH] fbcon: fix null-ptr-deref in fbcon_switch

2020-03-30 Thread Qiujun Huang
Add check for vc_cons[logo_shown].d, as it can be released by vt_ioctl(VT_DISALLOCATE). Reported-by: syzbot+732528bae351682f1...@syzkaller.appspotmail.com Signed-off-by: Qiujun Huang --- drivers/video/fbdev/core/fbcon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a