public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Hassan Shahbazi <h.shahbazi.git@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers: tty: vt: vt.c: fix NULL dereference crash
Date: Fri, 12 Mar 2021 09:33:37 +0100	[thread overview]
Message-ID: <YEsnYVwzRoEsbkie@kroah.com> (raw)
In-Reply-To: <20210307105642.112572-1-h.shahbazi.git@gmail.com>

On Sun, Mar 07, 2021 at 12:56:43PM +0200, Hassan Shahbazi wrote:
> Fix a NULL deference crash on hiding the cursor.
> 
> Reported by: syzbot
> https://syzkaller.appspot.com/bug?id=defb47bf56e1c14d5687280c7bb91ce7b608b94b
> 
> Signed-off-by: Hassan Shahbazi <h.shahbazi.git@gmail.com>
> ---
>  drivers/tty/vt/vt.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
> index 284b07224c55..8c3e83c81341 100644
> --- a/drivers/tty/vt/vt.c
> +++ b/drivers/tty/vt/vt.c
> @@ -904,7 +904,9 @@ static void hide_cursor(struct vc_data *vc)
>  	if (vc_is_sel(vc))
>  		clear_selection();
>  
> -	vc->vc_sw->con_cursor(vc, CM_ERASE);
> +	if (vc->vc_sw)
> +		vc->vc_sw->con_cursor(vc, CM_ERASE);
> +
>  	hide_softcursor(vc);
>  }
>  
> -- 
> 2.26.2
> 

Are you sure this actually fixes the problem?  How did you test it?  Did
syzbot test this?

I had a few reports of this patch _not_ solving the problem, so getting
confirmation of this would be good.

thanks,

greg k-h

  reply	other threads:[~2021-03-12  8:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-07 10:56 [PATCH] drivers: tty: vt: vt.c: fix NULL dereference crash Hassan Shahbazi
2021-03-12  8:33 ` Greg KH [this message]
2021-03-12  9:07   ` Fatih Yildirim
2021-03-12 15:43     ` Du Cheng
2021-03-13  9:12   ` Hassan Shahbazi
2021-03-12 15:05 ` Du Cheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YEsnYVwzRoEsbkie@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=h.shahbazi.git@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox