Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp261181pxf; Wed, 31 Mar 2021 23:57:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0vzVbwDIdWSgWVkeXA6+26AW0yXNPPIs5eW95g38IQcBr2IUR/j9/Bgnc5R5q9szsbbR8 X-Received: by 2002:a05:6402:524e:: with SMTP id t14mr8306968edd.371.1617260234055; Wed, 31 Mar 2021 23:57:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617260234; cv=none; d=google.com; s=arc-20160816; b=tI5L4K9jTQRaaXsZN6QtEgSfYBgiSMF9UCjTAzRKJOHucy3+Y9Iob0HPiBGf8RT2Hp mN2aG/YP2kIngXaQEhFHa4W+2BUwm1oUU5QEYwNcdNfEpciomy9jd0Iv3TwXLCCyie7X 5F50wE49y/EbhhPlY0jXX6r+F+wnRz66JYtgyfsrpL2gi805D5ZabqgRueXq+keB6NwH mncYUqagaMVBBQBuwnKDok+qD6UUqTNkWo7eOpe/pGb1I0NQd5AfiUwGDbiG/hMgRNGw lE4MNTOQJe7ZnG4Q2+FC921EnL9L0MUlWB+JitdvGyXMoo0qNq7lnuqAbr9IcSyO0zGK PIzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=URIrUgHSBIRESlQXSrmxvjewvG+SRXC5bbPDJPP6k/U=; b=wYaZbop2BpL7cx7Lxlhq6/17NCtGWEJpKY32wFqB6/M8TK8vUdecIRRzw3KToccfVw 5XGggz+NLRgO0GY70kjNefd7Tf798iIZY0eDlrVD6QpdjVmeJkGDevHv7V7FjwzMqvqH QEeYvwJWXN0gU6dIM5aceo73OLEJiwyKf74mWPrxXaaMX9gnffbiofbJrCYfXF+1mQBx 46c9/aaMrM02lPvZwmVKV7w/KwdfbjU1fviCdl20x+lN53behRfn7GkQOo9ccIuY1Gs/ mTMcimdFnFotiatD0tE72LvTGDm2iBqN9BUzL5NvOhDahH40/kcQQG911CVs9YXtX51a L7cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Sc1VRMiQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n7si3876261ejl.155.2021.03.31.23.56.52; Wed, 31 Mar 2021 23:57:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Sc1VRMiQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233565AbhDAGy6 (ORCPT + 99 others); Thu, 1 Apr 2021 02:54:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:40438 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233774AbhDAGye (ORCPT ); Thu, 1 Apr 2021 02:54:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 038B661057; Thu, 1 Apr 2021 06:54:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617260074; bh=olBbX+eEb1nBYZbDd0ck5A12mgL8uVtqeDAVawW24dQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Sc1VRMiQyANJhKGyqJErYjYUOSRK1lkiI9lw0K9FTavjnfuy1uzHTRrEVy9ULzQ8s nWSBhJvWwfa2oAH8glI+AxZ7UtgSS5n+aHny8NhuSW4QQ0iaoycw+OvekaV6K3+KFA Zpag93h+B/WpiFCFRzWt8RXH9IrGJTEFUWbsbjB4= Date: Thu, 1 Apr 2021 08:54:31 +0200 From: Greg KH To: Hassan Shahbazi Cc: daniel.vetter@ffwll.ch, jirislaby@kernel.org, yepeilin.cs@gmail.com, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fix NULL pointer deference crash Message-ID: References: <20210331163425.8092-1-h.shahbazi.git@gmail.com> <20210401062154.5evjajj64r4tjseh@gentoo> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210401062154.5evjajj64r4tjseh@gentoo> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 01, 2021 at 09:21:54AM +0300, Hassan Shahbazi wrote: > On Wed, Mar 31, 2021 at 07:32:06PM +0200, Greg KH wrote: > > On Wed, Mar 31, 2021 at 07:34:29PM +0300, Hassan Shahbazi wrote: > > > The patch has fixed a NULL pointer deference crash in hiding the cursor. It > > > is verified by syzbot patch tester. > > > > > > Reported by: syzbot > > > https://syzkaller.appspot.com/bug?id=defb47bf56e1c14d5687280c7bb91ce7b608b94b > > > > > > Signed-off-by: Hassan Shahbazi > > > --- > > > drivers/video/fbdev/core/fbcon.c | 5 +++-- > > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c > > > index 44a5cd2f54cc..ee252d1c43c6 100644 > > > --- a/drivers/video/fbdev/core/fbcon.c > > > +++ b/drivers/video/fbdev/core/fbcon.c > > > @@ -1333,8 +1333,9 @@ static void fbcon_cursor(struct vc_data *vc, int mode) > > > > > > ops->cursor_flash = (mode == CM_ERASE) ? 0 : 1; > > > > > > - ops->cursor(vc, info, mode, get_color(vc, info, c, 1), > > > - get_color(vc, info, c, 0)); > > > + if (ops && ops->cursor) > > > > As ops obviously is not NULL here (you just used it on the line above), > > why are you checking it again? > > Yes, that's right. I will remove that check and will submit a new patch. > > > > And what makes curser be NULL here? How can that happen? > > Honestly, I don't know. I reproduced the crash on my local, followed the > stack trace, and then changed the line to avoid the crash. If you think this > patch is not the best solution, I can drop it and investigate more to find > the root cause. Finding the root cause would be good to do here, so that we can potentially fix that if it is needed. thanks, greg k-h