Commit 0f81b041 authored by Helge Deller's avatar Helge Deller Committed by Jialin Zhang
Browse files

vt: Clear selection before changing the font

stable inclusion
from stable-v5.10.142
commit 989201bb8c00b222235aff04e6200230d29dc7bb
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6CSFH

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=989201bb8c00b222235aff04e6200230d29dc7bb



--------------------------------

commit 566f9c9f upstream.

When changing the console font with ioctl(KDFONTOP) the new font size
can be bigger than the previous font. A previous selection may thus now
be outside of the new screen size and thus trigger out-of-bounds
accesses to graphics memory if the selection is removed in
vc_do_resize().

Prevent such out-of-memory accesses by dropping the selection before the
various con_font_set() console handlers are called.

Reported-by: default avatar <syzbot+14b0e8f3fd1612e35350@syzkaller.appspotmail.com>
Cc: stable <stable@kernel.org>
Tested-by: default avatarKhalid Masum <khalid.masum.92@gmail.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Link: https://lore.kernel.org/r/YuV9apZGNmGfjcor@p100


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
Reviewed-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent d4e959eb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment