Skip to content

Commit 1581daf

Browse files
npitregregkh
authored andcommitted
vt: fix unicode buffer corruption when deleting characters
This is the same issue that was fixed for the VGA text buffer in commit 39cdb68 ("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: 81732c3 ("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>
1 parent 43066e3 commit 1581daf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/tty/vt/vt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ static void vc_uniscr_delete(struct vc_data *vc, unsigned int nr)
381381
u32 *ln = vc->vc_uni_lines[vc->state.y];
382382
unsigned int x = vc->state.x, cols = vc->vc_cols;
383383

384-
memcpy(&ln[x], &ln[x + nr], (cols - x - nr) * sizeof(*ln));
384+
memmove(&ln[x], &ln[x + nr], (cols - x - nr) * sizeof(*ln));
385385
memset32(&ln[cols - nr], ' ', nr);
386386
}
387387
}

0 commit comments

Comments
 (0)