linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix NULL pointer deference crash
@ 2021-03-31 16:34 Hassan Shahbazi
  2021-03-31 17:32 ` Greg KH
  2021-03-31 20:02 ` Dan Carpenter
  0 siblings, 2 replies; 5+ messages in thread
From: Hassan Shahbazi @ 2021-03-31 16:34 UTC (permalink / raw)
  To: gregkh, daniel.vetter, jirislaby, yepeilin.cs
  Cc: linux-fbdev, dri-devel, linux-kernel, Hassan Shahbazi

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 <h.shahbazi.git@gmail.com>
---
 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)
+		ops->cursor(vc, info, mode, get_color(vc, info, c, 1),
+				get_color(vc, info, c, 0));
 }
 
 static int scrollback_phys_max = 0;
-- 
2.26.3


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

end of thread, other threads:[~2021-04-01  6:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-31 16:34 [PATCH] fix NULL pointer deference crash Hassan Shahbazi
2021-03-31 17:32 ` Greg KH
2021-04-01  6:21   ` Hassan Shahbazi
2021-04-01  6:54     ` Greg KH
2021-03-31 20:02 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).