All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers: tty: vt: vt.c: fix NULL dereference crash
@ 2021-03-07 10:56 Hassan Shahbazi
  2021-03-12  8:33 ` Greg KH
  2021-03-12 15:05 ` Du Cheng
  0 siblings, 2 replies; 6+ messages in thread
From: Hassan Shahbazi @ 2021-03-07 10:56 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Hassan Shahbazi

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] drivers: tty: vt: vt.c: fix NULL dereference crash
  2021-03-07 10:56 [PATCH] drivers: tty: vt: vt.c: fix NULL dereference crash Hassan Shahbazi
@ 2021-03-12  8:33 ` Greg KH
  2021-03-12  9:07   ` Fatih Yildirim
  2021-03-13  9:12   ` Hassan Shahbazi
  2021-03-12 15:05 ` Du Cheng
  1 sibling, 2 replies; 6+ messages in thread
From: Greg KH @ 2021-03-12  8:33 UTC (permalink / raw)
  To: Hassan Shahbazi; +Cc: linux-kernel

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drivers: tty: vt: vt.c: fix NULL dereference crash
  2021-03-12  8:33 ` Greg KH
@ 2021-03-12  9:07   ` Fatih Yildirim
  2021-03-12 15:43     ` Du Cheng
  2021-03-13  9:12   ` Hassan Shahbazi
  1 sibling, 1 reply; 6+ messages in thread
From: Fatih Yildirim @ 2021-03-12  9:07 UTC (permalink / raw)
  To: Greg KH, Hassan Shahbazi; +Cc: linux-kernel

On Fri, 2021-03-12 at 09:33 +0100, Greg KH wrote:
> 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

Hi,

I've tested the patch on upstream using the .config and the C
reproducer reported by syzbot. It seems that the patch doesn't fix the
issue.

Maybe you can send a patch test request to syzbot to validate the
patch.

Thanks,
Fatih



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] drivers: tty: vt: vt.c: fix NULL dereference crash
  2021-03-07 10:56 [PATCH] drivers: tty: vt: vt.c: fix NULL dereference crash Hassan Shahbazi
  2021-03-12  8:33 ` Greg KH
@ 2021-03-12 15:05 ` Du Cheng
  1 sibling, 0 replies; 6+ messages in thread
From: Du Cheng @ 2021-03-12 15:05 UTC (permalink / raw)
  To: h.shahbazi.git; +Cc: gregkh, linux-kernel, Du Cheng

Hi Hassan Shahbazi,

I also tested your patch locally with qemu, but it did not fix the crashing.

I sent test command to syzbot on upstream linux and am waiting for result.

Regards,
Du Cheng


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] drivers: tty: vt: vt.c: fix NULL dereference crash
  2021-03-12  9:07   ` Fatih Yildirim
@ 2021-03-12 15:43     ` Du Cheng
  0 siblings, 0 replies; 6+ messages in thread
From: Du Cheng @ 2021-03-12 15:43 UTC (permalink / raw)
  To: yildirim.fatih; +Cc: gregkh, h.shahbazi.git, linux-kernel, Du Cheng

Hi Fatih,
I just found out that the section [Patch testing requests] on
https://syzkaller.appspot.com/bug?id=defb47bf56e1c14d5687280c7bb91ce7b608b94b,
indicates that you did not attach the patch when sending email to syzbot. syzbot
was simply testing the vallina upstream with repro.c, so it failed as expected.

Anyway, I resent the test email *with the patch* from Hassan to syzbot, and
let's see the result.

Regards,
Du Cheng


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drivers: tty: vt: vt.c: fix NULL dereference crash
  2021-03-12  8:33 ` Greg KH
  2021-03-12  9:07   ` Fatih Yildirim
@ 2021-03-13  9:12   ` Hassan Shahbazi
  1 sibling, 0 replies; 6+ messages in thread
From: Hassan Shahbazi @ 2021-03-13  9:12 UTC (permalink / raw)
  To: Greg KH; +Cc: yildirim.fatih, ducheng2, linux-kernel

On Fri, Mar 12, 2021 at 09:33:37AM +0100, Greg KH wrote:
> 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

Unfortunately, it seems the patch has not fixed the bug. I drop this
patch and will continue working on a newer one.

Thanks for the feedback,
Hassan Shahbazi

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-03-13  9:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-07 10:56 [PATCH] drivers: tty: vt: vt.c: fix NULL dereference crash Hassan Shahbazi
2021-03-12  8:33 ` Greg KH
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.