diff mbox series

vt: fix unicode buffer corruption when deleting characters

Message ID 88n6qo5r-2986-r273-9n4p-pr77q314727r@syhkavp.arg
State New
Headers show
Series vt: fix unicode buffer corruption when deleting characters | expand

Commit Message

Nicolas Pitre Feb. 29, 2024, 9:05 p.m. UTC
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.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Cc: <stable@kernel.org>
---

Comments

Greg Kroah-Hartman Feb. 29, 2024, 9:51 p.m. UTC | #1
On Thu, Feb 29, 2024 at 04:05:51PM -0500, Nicolas Pitre wrote:
> 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.

Please spell out what the "cure" is here, so we don't have to do and
look up another commit somewhere else :)

thanks,

greg k-h
Nicolas Pitre Feb. 29, 2024, 10:10 p.m. UTC | #2
On Thu, 29 Feb 2024, Greg Kroah-Hartman wrote:

> On Thu, Feb 29, 2024 at 04:05:51PM -0500, Nicolas Pitre wrote:
> > 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.
> 
> Please spell out what the "cure" is here, so we don't have to do and
> look up another commit somewhere else :)

This is an obvious single-line fix. Or, are people only reviewing commit 
logs now?  ;-)

Revised commit log coming.


Nicolas
Greg Kroah-Hartman March 2, 2024, 8:45 p.m. UTC | #3
On Thu, Feb 29, 2024 at 05:10:56PM -0500, Nicolas Pitre wrote:
> On Thu, 29 Feb 2024, Greg Kroah-Hartman wrote:
> 
> > On Thu, Feb 29, 2024 at 04:05:51PM -0500, Nicolas Pitre wrote:
> > > 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.
> > 
> > Please spell out what the "cure" is here, so we don't have to do and
> > look up another commit somewhere else :)
> 
> This is an obvious single-line fix. Or, are people only reviewing commit 
> logs now?  ;-)

We always review them :)

> Revised commit log coming.

Thanks for the update.

greg k-h
diff mbox series

Patch

diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 156efda7c8..38a765eadb 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -381,7 +381,7 @@  static void vc_uniscr_delete(struct vc_data *vc, unsigned int nr)
 		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);
 	}
 }