[Hardy-Karmic] SRU: vgacon: Return the upper half of 512 character fonts

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Hardy-Karmic] SRU: vgacon: Return the upper half of 512 character fonts

Stefan Bader-2
[Present in all versions since the start of git]

SRU justification:

Impact: The use of 512 character fonts on a vga console is broken since
seemingly ever until now somebody noticed. While not being a panic spreading
issue it can simply be fixed.

Fix: Let the get_font function return the complete character set and not
only the first 256 characters, while pretending to have done all. Fix
sent to upstream.

Testcase: Call showconsolefont after loading a 512 character font and do not
panic (seems to be another bug in there), switch console and back and the
second half of the font is corrupted.

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH] vgacon: Return the upper half of 512 character fonts

Stefan Bader-2
Bug: #355057

Uwe Geuder noted that he gets random bitmaps on a text console if he tried
to type extended characters (like the e acute). For him everything above
unicode 0xa0 was corrupted.

After some digging there seems to be a little culprit in vgacon since the
beginning of ages (well git). The function vgacon_font_get will store the
number of characters correctly in font->charcount but then calls to
vgacon_do_font_op(..., 0, 0). Which means only the lower 256 characters are
actually stored to the fontdata. The rest is left untouched. So the next time
that saved data is used, the garbled font appears. This happens on every
switch between text consoles.

Signed-off-by: Stefan Bader <[hidden email]>
Tested-by: Uwe Geuder <[hidden email]>
---
 drivers/video/console/vgacon.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index d012edd..38e86b8 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -1282,7 +1282,7 @@ static int vgacon_font_get(struct vc_data *c, struct console_font *font)
  font->charcount = vga_512_chars ? 512 : 256;
  if (!font->data)
  return 0;
- return vgacon_do_font_op(&state, font->data, 0, 0);
+ return vgacon_do_font_op(&state, font->data, 0, vga_512_chars);
 }
 
 #else
--
1.5.4.3


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] vgacon: Return the upper half of 512 character fonts

Amit Kucheria-6
On Tue, Apr 21, 2009 at 07:47:48PM +0200, Stefan Bader wrote:

> Bug: #355057
>
> Uwe Geuder noted that he gets random bitmaps on a text console if he tried
> to type extended characters (like the e acute). For him everything above
> unicode 0xa0 was corrupted.
>
> After some digging there seems to be a little culprit in vgacon since the
> beginning of ages (well git). The function vgacon_font_get will store the
> number of characters correctly in font->charcount but then calls to
> vgacon_do_font_op(..., 0, 0). Which means only the lower 256 characters are
> actually stored to the fontdata. The rest is left untouched. So the next time
> that saved data is used, the garbled font appears. This happens on every
> switch between text consoles.
>
> Signed-off-by: Stefan Bader <[hidden email]>
> Tested-by: Uwe Geuder <[hidden email]>
> ---
>  drivers/video/console/vgacon.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
> index d012edd..38e86b8 100644
> --- a/drivers/video/console/vgacon.c
> +++ b/drivers/video/console/vgacon.c
> @@ -1282,7 +1282,7 @@ static int vgacon_font_get(struct vc_data *c, struct console_font *font)
>   font->charcount = vga_512_chars ? 512 : 256;
>   if (!font->data)
>   return 0;
> - return vgacon_do_font_op(&state, font->data, 0, 0);
> + return vgacon_do_font_op(&state, font->data, 0, vga_512_chars);
>  }
>  
>  #else

Who is the author of this patch?

Is this a cherry-pick from upstream? Or will it be pushed upstream?

--
----------------------------------------------------------------------
Amit Kucheria, Kernel Engineer || [hidden email]
----------------------------------------------------------------------

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] vgacon: Return the upper half of 512 character fonts

Stefan Bader-2
Some day I learn to hit the send-all on the first attempt...
>
> Who is the author of this patch?
>
/me

> Is this a cherry-pick from upstream? Or will it be pushed upstream?
>

Yes, I forgot to add the SAUCE. Sent it upstream today.



--

When all other means of communication fail, try words!



--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] vgacon: Return the upper half of 512 character fonts

Stefan Bader-2
In reply to this post by Stefan Bader-2
Stefan Bader wrote:
> Bug: #355057
>
Accepted into -mm

> Uwe Geuder noted that he gets random bitmaps on a text console if he tried
> to type extended characters (like the e acute). For him everything above
> unicode 0xa0 was corrupted.
>
> After some digging there seems to be a little culprit in vgacon since the
> beginning of ages (well git). The function vgacon_font_get will store the
> number of characters correctly in font->charcount but then calls to
> vgacon_do_font_op(..., 0, 0). Which means only the lower 256 characters are
> actually stored to the fontdata. The rest is left untouched. So the next time
> that saved data is used, the garbled font appears. This happens on every
> switch between text consoles.
>
> Signed-off-by: Stefan Bader <[hidden email]>
> Tested-by: Uwe Geuder <[hidden email]>
> ---
>  drivers/video/console/vgacon.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
> index d012edd..38e86b8 100644
> --- a/drivers/video/console/vgacon.c
> +++ b/drivers/video/console/vgacon.c
> @@ -1282,7 +1282,7 @@ static int vgacon_font_get(struct vc_data *c, struct console_font *font)
>   font->charcount = vga_512_chars ? 512 : 256;
>   if (!font->data)
>   return 0;
> - return vgacon_do_font_op(&state, font->data, 0, 0);
> + return vgacon_do_font_op(&state, font->data, 0, vga_512_chars);
>  }
>  
>  #else


--

When all other means of communication fail, try words!



--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: [Hardy-Karmic] SRU: vgacon: Return the upper half of 512 character fonts

Amit Kucheria-6
In reply to this post by Stefan Bader-2
On Tue, Apr 21, 2009 at 07:47:47PM +0200, Stefan Bader wrote:

> [Present in all versions since the start of git]
>
> SRU justification:
>
> Impact: The use of 512 character fonts on a vga console is broken since
> seemingly ever until now somebody noticed. While not being a panic spreading
> issue it can simply be fixed.
>
> Fix: Let the get_font function return the complete character set and not
> only the first 256 characters, while pretending to have done all. Fix
> sent to upstream.
>
> Testcase: Call showconsolefont after loading a 512 character font and do not
> panic (seems to be another bug in there), switch console and back and the
> second half of the font is corrupted.

I guess I forgot to ACK the patch after the questions :)

ACK.

--
----------------------------------------------------------------------
Amit Kucheria, Kernel Engineer || [hidden email]
----------------------------------------------------------------------

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team