All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vt: Fix screen updates after CSI K sequences
@ 2018-11-03 17:48 Samuel Holland
  2018-11-03 19:30 ` Nicolas Pitre
  0 siblings, 1 reply; 2+ messages in thread
From: Samuel Holland @ 2018-11-03 17:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Nicolas Pitre
  Cc: Adam Borowski, Samuel Holland, Mike Frysinger,
	Alexander Potapenko, linux-kernel, stable

In d8ae72427187, start was changed to point to the character under the
cursor, instead of the beginning of the cleared area. The offset was
correctly applied when clearing the backing buffer, but not when
updating the framebuffer region. Fix this by having start point once
again to the beginning of the cleared area.

Cc: stable@vger.kernel.org
Fixes: d8ae72427187 ("vt: preserve unicode values corresponding to screen characters")
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
 drivers/tty/vt/vt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 5f1183b0b89d..be7bc83d6c41 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -1528,7 +1528,7 @@ static void csi_J(struct vc_data *vc, int vpar)
 static void csi_K(struct vc_data *vc, int vpar)
 {
 	unsigned int count;
-	unsigned short *start = (unsigned short *)vc->vc_pos;
+	unsigned short *start;
 	int offset;
 
 	switch (vpar) {
@@ -1548,7 +1548,8 @@ static void csi_K(struct vc_data *vc, int vpar)
 			return;
 	}
 	vc_uniscr_clear_line(vc, vc->vc_x + offset, count);
-	scr_memsetw(start + offset, vc->vc_video_erase_char, 2 * count);
+	start = (unsigned short *)vc->vc_pos + offset;
+	scr_memsetw(start, vc->vc_video_erase_char, 2 * count);
 	vc->vc_need_wrap = 0;
 	if (con_should_update(vc))
 		do_update_region(vc, (unsigned long) start, count);
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] vt: Fix screen updates after CSI K sequences
  2018-11-03 17:48 [PATCH] vt: Fix screen updates after CSI K sequences Samuel Holland
@ 2018-11-03 19:30 ` Nicolas Pitre
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Pitre @ 2018-11-03 19:30 UTC (permalink / raw)
  To: Samuel Holland
  Cc: Greg Kroah-Hartman, Jiri Slaby, Adam Borowski, Mike Frysinger,
	Alexander Potapenko, linux-kernel, stable

On Sat, 3 Nov 2018, Samuel Holland wrote:

> In d8ae72427187, start was changed to point to the character under the
> cursor, instead of the beginning of the cleared area. The offset was
> correctly applied when clearing the backing buffer, but not when
> updating the framebuffer region. Fix this by having start point once
> again to the beginning of the cleared area.

There is already a slightly better fix submitted here:

https://lkml.org/lkml/2018/10/23/535


Nicolas

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-03 19:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-03 17:48 [PATCH] vt: Fix screen updates after CSI K sequences Samuel Holland
2018-11-03 19:30 ` Nicolas Pitre

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.