From: Greg Kroah-Hartman Date: Wed, 1 Sep 2021 08:34:45 +0000 (+0200) Subject: 5.14-stable patches X-Git-Tag: v4.4.283~38 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aa8477e2d607544afee89d7bf6d495bd03282018;p=thirdparty%2Fkernel%2Fstable-queue.git 5.14-stable patches added patches: vt_kdsetmode-extend-console-locking.patch --- diff --git a/queue-5.14/series b/queue-5.14/series new file mode 100644 index 00000000000..ff12b84b4e9 --- /dev/null +++ b/queue-5.14/series @@ -0,0 +1 @@ +vt_kdsetmode-extend-console-locking.patch diff --git a/queue-5.14/vt_kdsetmode-extend-console-locking.patch b/queue-5.14/vt_kdsetmode-extend-console-locking.patch new file mode 100644 index 00000000000..6933476ad05 --- /dev/null +++ b/queue-5.14/vt_kdsetmode-extend-console-locking.patch @@ -0,0 +1,64 @@ +From 2287a51ba822384834dafc1c798453375d1107c7 Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Mon, 30 Aug 2021 08:55:18 -0700 +Subject: vt_kdsetmode: extend console locking + +From: Linus Torvalds + +commit 2287a51ba822384834dafc1c798453375d1107c7 upstream. + +As per the long-suffering comment. + +Reported-by: Minh Yuan +Cc: Greg Kroah-Hartman +Cc: Jiri Slaby +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/vt/vt_ioctl.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/tty/vt/vt_ioctl.c ++++ b/drivers/tty/vt/vt_ioctl.c +@@ -246,6 +246,8 @@ int vt_waitactive(int n) + * + * XXX It should at least call into the driver, fbdev's definitely need to + * restore their engine state. --BenH ++ * ++ * Called with the console lock held. + */ + static int vt_kdsetmode(struct vc_data *vc, unsigned long mode) + { +@@ -262,7 +264,6 @@ static int vt_kdsetmode(struct vc_data * + return -EINVAL; + } + +- /* FIXME: this needs the console lock extending */ + if (vc->vc_mode == mode) + return 0; + +@@ -271,12 +272,10 @@ static int vt_kdsetmode(struct vc_data * + return 0; + + /* explicitly blank/unblank the screen if switching modes */ +- console_lock(); + if (mode == KD_TEXT) + do_unblank_screen(1); + else + do_blank_screen(1); +- console_unlock(); + + return 0; + } +@@ -378,7 +377,10 @@ static int vt_k_ioctl(struct tty_struct + if (!perm) + return -EPERM; + +- return vt_kdsetmode(vc, arg); ++ console_lock(); ++ ret = vt_kdsetmode(vc, arg); ++ console_unlock(); ++ return ret; + + case KDGETMODE: + return put_user(vc->vc_mode, (int __user *)arg);