提交 ab748ddc 编写于 作者: L Linus Torvalds 提交者: Yang Yingliang

vt_kdsetmode: extend console locking

stable inclusion
from linux-4.19.206
commit 0776c1a20babb4ad0b7ce7f2f4e0806a97663187
CVE: CVE-2021-3753

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

commit 2287a51b upstream.

As per the long-suffering comment.
Reported-by: NMinh Yuan <yuanmingbuaa@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NXiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 1e3910c7
...@@ -484,16 +484,19 @@ int vt_ioctl(struct tty_struct *tty, ...@@ -484,16 +484,19 @@ int vt_ioctl(struct tty_struct *tty,
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
/* FIXME: this needs the console lock extending */ console_lock();
if (vc->vc_mode == (unsigned char) arg) if (vc->vc_mode == (unsigned char) arg) {
console_unlock();
break; break;
}
vc->vc_mode = (unsigned char) arg; vc->vc_mode = (unsigned char) arg;
if (console != fg_console) if (console != fg_console) {
console_unlock();
break; break;
}
/* /*
* explicitly blank/unblank the screen if switching modes * explicitly blank/unblank the screen if switching modes
*/ */
console_lock();
if (arg == KD_TEXT) if (arg == KD_TEXT)
do_unblank_screen(1); do_unblank_screen(1);
else else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册