Skip to content

Commit 2e9c949

Browse files
committed
vt: fix unicode buffer corruption when deleting characters
jira LE-1907 cve CVE-2024-35823 Rebuild_History Non-Buildable kernel-5.14.0-427.31.1.el9_4 commit-author Nicolas Pitre <nico@fluxnic.net> commit 1581daf 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> (cherry picked from commit 1581daf) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 9b3b653 commit 2e9c949

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
@@ -398,7 +398,7 @@ static void vc_uniscr_delete(struct vc_data *vc, unsigned int nr)
398398
char32_t *ln = uniscr->lines[vc->state.y];
399399
unsigned int x = vc->state.x, cols = vc->vc_cols;
400400

401-
memcpy(&ln[x], &ln[x + nr], (cols - x - nr) * sizeof(*ln));
401+
memmove(&ln[x], &ln[x + nr], (cols - x - nr) * sizeof(*ln));
402402
memset32(&ln[cols - nr], ' ', nr);
403403
}
404404
}

0 commit comments

Comments
 (0)