aboutsummaryrefslogtreecommitdiffstats
path: root/queue-6.6/vt-fix-unicode-buffer-corruption-when-deleting-characters.patch
diff options
context:
space:
mode:
Diffstat (limited to 'queue-6.6/vt-fix-unicode-buffer-corruption-when-deleting-characters.patch')
-rw-r--r--queue-6.6/vt-fix-unicode-buffer-corruption-when-deleting-characters.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/queue-6.6/vt-fix-unicode-buffer-corruption-when-deleting-characters.patch b/queue-6.6/vt-fix-unicode-buffer-corruption-when-deleting-characters.patch
new file mode 100644
index 0000000000..6cfb8a3f2f
--- /dev/null
+++ b/queue-6.6/vt-fix-unicode-buffer-corruption-when-deleting-characters.patch
@@ -0,0 +1,34 @@
+From 1581dafaf0d34bc9c428a794a22110d7046d186d Mon Sep 17 00:00:00 2001
+From: Nicolas Pitre <nico@fluxnic.net>
+Date: Thu, 29 Feb 2024 17:15:27 -0500
+Subject: vt: fix unicode buffer corruption when deleting characters
+
+From: Nicolas Pitre <nico@fluxnic.net>
+
+commit 1581dafaf0d34bc9c428a794a22110d7046d186d upstream.
+
+This is the same issue that was fixed for the VGA text buffer in commit
+39cdb68c64d8 ("vt: fix memory overlapping when deleting chars in the
+buffer"). The cure is also the same i.e. replace memcpy() with memmove()
+due to the overlaping buffers.
+
+Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
+Fixes: 81732c3b2fed ("tty vt: Fix line garbage in virtual console on command line edition")
+Cc: stable <stable@kernel.org>
+Link: https://lore.kernel.org/r/sn184on2-3p0q-0qrq-0218-895349s4753o@syhkavp.arg
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/tty/vt/vt.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/tty/vt/vt.c
++++ b/drivers/tty/vt/vt.c
+@@ -381,7 +381,7 @@ static void vc_uniscr_delete(struct vc_d
+ u32 *ln = vc->vc_uni_lines[vc->state.y];
+ unsigned int x = vc->state.x, cols = vc->vc_cols;
+
+- memcpy(&ln[x], &ln[x + nr], (cols - x - nr) * sizeof(*ln));
++ memmove(&ln[x], &ln[x + nr], (cols - x - nr) * sizeof(*ln));
+ memset32(&ln[cols - nr], ' ', nr);
+ }
+ }