From: Du Cheng Date: Fri, 12 Mar 2021 08:14:21 +0000 (+0800) Subject: drivers: video: fbcon: fix NULL dereference in fbcon_cursor() X-Git-Tag: v5.10.79~5891 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=61f0c3e8098facbec81dcc32508d58c8611cb799;p=platform%2Fkernel%2Flinux-rpi.git drivers: video: fbcon: fix NULL dereference in fbcon_cursor() commit 01faae5193d6190b7b3aa93dae43f514e866d652 upstream. add null-check on function pointer before dereference on ops->cursor Reported-by: syzbot+b67aaae8d3a927f68d20@syzkaller.appspotmail.com Cc: stable Signed-off-by: Du Cheng Link: https://lore.kernel.org/r/20210312081421.452405-1-ducheng2@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 8d1ae97..2658119 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -1344,6 +1344,9 @@ static void fbcon_cursor(struct vc_data *vc, int mode) ops->cursor_flash = (mode == CM_ERASE) ? 0 : 1; + if (!ops->cursor) + return; + ops->cursor(vc, info, mode, get_color(vc, info, c, 1), get_color(vc, info, c, 0)); }