]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fbdev: fbcon: Properly revert changes when vc_resize() failed
authorShigeru Yoshida <syoshida@redhat.com>
Thu, 18 Aug 2022 18:13:36 +0000 (03:13 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Aug 2022 15:18:16 +0000 (17:18 +0200)
commitf08ccb792d3eaf1dc62d8cbf6a30d6522329f660
tree838c7d11fca84ba6ad0a5b7de2ebe0f2cee9a83c
parentfbdc482d43eda40a70de4b0155843d5472f6de62
fbdev: fbcon: Properly revert changes when vc_resize() failed

commit a5a923038d70d2d4a86cb4e3f32625a5ee6e7e24 upstream.

fbcon_do_set_font() calls vc_resize() when font size is changed.
However, if if vc_resize() failed, current implementation doesn't
revert changes for font size, and this causes inconsistent state.

syzbot reported unable to handle page fault due to this issue [1].
syzbot's repro uses fault injection which cause failure for memory
allocation, so vc_resize() failed.

This patch fixes this issue by properly revert changes for font
related date when vc_resize() failed.

Link: https://syzkaller.appspot.com/bug?id=3443d3a1fa6d964dd7310a0cb1696d165a3e07c4
Reported-by: syzbot+a168dbeaaa7778273c1b@syzkaller.appspotmail.com
Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>
Signed-off-by: Helge Deller <deller@gmx.de>
CC: stable@vger.kernel.org # 5.15+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/video/fbdev/core/fbcon.c