text screen corruption - bug in console vga code

Chen, Kenneth W (kenneth.w.chen@intel.com)
Sun, 28 Jul 2002 14:04:39 -0700


We have observed text mode console screen corruption on some architecture.
The symptom was on a text console, when edit a large file with vi, pressing
"down" arrow key to scroll would cause the corruption.

It turns out that the culprit was the kernel console vga code where scrup()
is illegally using mempcy() function when src/dest memory areas overlaps.
This bug showed up when we optimized memcpy to use advanced optimization
technique.

This patch make use of memmove() which handles overlapping areas gracefully.
Would the maintainer please push this into the base?

--- drivers/char/console.c.orig Wed Jul 24 14:47:20 2002
+++ drivers/char/console.c Wed Jul 24 14:47:55 2002
@@ -259,7 +259,7 @@
return;
d = (unsigned short *) (origin+video_size_row*t);
s = (unsigned short *) (origin+video_size_row*(t+nr));
- scr_memcpyw(d, s, (b-t-nr) * video_size_row);
+ scr_memmovew(d, s, (b-t-nr) * video_size_row);
scr_memsetw(d + (b-t-nr) * video_num_columns, video_erase_char,
video_size_row*nr);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/