]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.19.37/vt-fix-cursor-when-clearing-the-screen.patch
Linux 4.14.114
[thirdparty/kernel/stable-queue.git] / releases / 4.19.37 / vt-fix-cursor-when-clearing-the-screen.patch
1 From b2ecf00631362a83744e5ec249947620db5e240c Mon Sep 17 00:00:00 2001
2 From: Mikulas Patocka <mpatocka@redhat.com>
3 Date: Thu, 4 Apr 2019 20:53:28 -0400
4 Subject: vt: fix cursor when clearing the screen
5
6 From: Mikulas Patocka <mpatocka@redhat.com>
7
8 commit b2ecf00631362a83744e5ec249947620db5e240c upstream.
9
10 The patch a6dbe4427559 ("vt: perform safe console erase in the right
11 order") introduced a bug. The conditional do_update_region() was
12 replaced by a call to update_region() that does contain the conditional
13 already, but with unwanted extra side effects such as restoring the cursor
14 drawing.
15
16 In order to reproduce the bug:
17 - use framebuffer console with the AMDGPU driver
18 - type "links" to start the console www browser
19 - press 'q' and space to exit links
20
21 Now the cursor will be permanently visible in the center of the
22 screen. It will stay there until something overwrites it.
23
24 The bug goes away if we change update_region() back to the conditional
25 do_update_region().
26
27 [ nico: reworded changelog ]
28
29 Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
30 Reviewed-by: Nicolas Pitre <nico@fluxnic.net>
31 Cc: stable@vger.kernel.org
32 Fixes: a6dbe4427559 ("vt: perform safe console erase in the right order")
33 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
34
35 ---
36 drivers/tty/vt/vt.c | 3 ++-
37 1 file changed, 2 insertions(+), 1 deletion(-)
38
39 --- a/drivers/tty/vt/vt.c
40 +++ b/drivers/tty/vt/vt.c
41 @@ -1521,7 +1521,8 @@ static void csi_J(struct vc_data *vc, in
42 return;
43 }
44 scr_memsetw(start, vc->vc_video_erase_char, 2 * count);
45 - update_region(vc, (unsigned long) start, count);
46 + if (con_should_update(vc))
47 + do_update_region(vc, (unsigned long) start, count);
48 vc->vc_need_wrap = 0;
49 }
50