2005-01-04 10:54:29

by [email protected]

[permalink] [raw]
Subject: [PATCH]vt.c, kernel 2.6.10 (also applies to 2.4.28 and 2.2.26).


There is a minor bug into the linux console driver.
It appeared in kernel 2.1.112 (but the ChangeLog is void about
this modification), and affects 2.2, 2.4 and 2.6 trees.

The point is about the DEC screen alignment test : the kernel is fulling
the text console with 'E's (witch is the correct behaviour) without
checking if the process who sent the screen alignment test sequence
is the owner of the current console.

In kernels 2.2.26 and 2.4.28, the file drivers/char/vt.c was called
drivers/char/console.c .

Notice : I've tested my patch on kernel 2.4, it works properly, and, since
it is a very little patch and very easy to understand (I think), I believe
it will also work with kernels 2.2 and 2.6, but I've made no test on them.
Please check my patch on 2.2 and 2.6 before applying it to these versions.

Checking can be done by login on vt1 and then typing :
$ chvt 2 && sleep 1 && echo -e "\033#8"
If vt2 gets full of 'E's, the kernel is broken.

Emmanuel Colbus


Attachments:
patch (393.00 B)
DEC_alignment_screen_test_fix
README (85.00 B)
README
DEC_alignment_test_patch (403.00 B)
2.4.28 patch
patch_2.2 (381.00 B)
2.2.26 patch
Download all attachments

2005-01-04 11:08:46

by [email protected]

[permalink] [raw]
Subject: Re: [PATCH]vt.c, kernel 2.6.10 (also applies to 2.4.28 and 2.2.26).



Sorry, my attachements are not well readable.
This is the 2.6.10 patch :

--- old/drivers/char/vt.c 2004-12-24 22:35:25.000000000 +0100
+++ patched/drivers/char/vt.c 2005-01-04 10:37:46.000000000 +0100
@@ -1847,7 +1847,7 @@
csi_J(currcons, 2);
video_erase_char =
(video_erase_char & 0xff00) | ' ';
- do_update_region(currcons, origin,
screenbuf_size/2);
+ update_region(currcons, origin, screenbuf_size/2);
}
return;
case ESsetG0:



----------------------------------------
This is the 2.4.28 patch :

--- old/drivers/char/console.c 2005-01-03 15:51:22.000000000 +0100
+++ patched/drivers/char/console.c 2005-01-03 15:31:45.000000000
+0100
@@ -1781,7 +1781,7 @@
csi_J(currcons, 2);
video_erase_char =
(video_erase_char & 0xff00) | ' ';
- do_update_region(currcons, origin,
screenbuf_size/2);
+ update_region(currcons, origin, screenbuf_size/2);
}
return;
case ESsetG0:



----------------------------------------
This is the 2.2.26 patch :

--- old/drivers/char/console.c Mon Sep 16 18:26:11 2002
+++ patched/drivers/char/console.c Tue Jan 4 09:54:58 2005
@@ -1742,7 +1742,7 @@
csi_J(currcons, 2);
video_erase_char =
(video_erase_char & 0xff00) | ' ';
- do_update_region(currcons, origin,
screenbuf_size/2);
+ update_region(currcons, origin, screenbuf_size/2);
}
return;
case ESsetG0:




----------------------------------------
This is the README file the linux-kernel mailing list FAQ recommands :

DEC screen alignment test bug fix Emmanuel Colbus
<[email protected]>