[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210307105642.112572-1-h.shahbazi.git@gmail.com>
Date: Sun, 7 Mar 2021 12:56:43 +0200
From: Hassan Shahbazi <h.shahbazi.git@...il.com>
To: gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org,
Hassan Shahbazi <h.shahbazi.git@...il.com>
Subject: [PATCH] drivers: tty: vt: vt.c: fix NULL dereference crash
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@...il.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
Powered by blists - more mailing lists