2022-06-27 10:50:30

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] vt: fix memory overlapping when deleting chars in the buffer

On Mon, Jun 27, 2022 at 06:29:40PM +0800, Yangxi Xiang wrote:
> A memory overlapping copy occurs when deleting a long line. Fix it by
> using scr_memmovew.
>
> Signed-off-by: Yangxi Xiang <[email protected]>

What commit does this fix? how was this tested?

thanks,

greg k-h


2022-06-27 11:23:58

by Yangxi Xiang

[permalink] [raw]
Subject: Re: [PATCH] vt: fix memory overlapping when deleting chars in the buffer

> What commit does this fix? how was this tested?

This bug is triggered by running a dynamic analysis on the kernel,
with the help of sanitizer to observe this bug. This memory
overlapping copy can cause data corruption when scr_memcpyw is
optimized to memcpy because memcpy does not ensure its behavior if
the destination buffer overlaps with the source buffer.

Yangxi Xiang