Thread (4 messages) 4 messages, 3 authors, 2004-06-19

Re: 2.6.7 fbcon: set_con2fb on current console = crash

flat view

From: Antonino A. Daplas <hidden>
Date: 2004-06-19 10:02:47
Also in: lkml

On Saturday 19 June 2004 17:28, Geert Uytterhoeven wrote:
On Sat, 19 Jun 2004, Antonino A. Daplas wrote:
quoted
Thanks.  Actually there's still a critical flaw in the set_con2fbmap
code. For one, con2fb_map is never initialized.  It's just fortunate that
this array happens to be  filled with zeroes so con2fb_map[n] will always
return zero and registered_fb[0] happens to contain a valid info.  So it
works, by accident.
According to the C standard, global variables are initialized to zero,
unless specified otherwise.
I know, but what I meant was con2fb_map[] is never initialized by fbcon.  So 
if the first valid fbdev is in registered_fb[1], then con2fbmap must be 
initialized to 1's by fbcon.  It doesn't.  Note, fbdev-2.4 does the 
initialization correctly.

So 2 critical flaws in the code:

1. con2fb_map[] is always zero-set
2. fbcon assumes that registered_fb[0] is always valid

Both flaws will manifest by doing this:

modprobe fbdev1 - in registered_fb[0]
modprobe fbdev2 - in registered_fb[1]
rmmod fbdev1      - registered_fb[0] becomes invalid
modprobe fbcon  
	 - con2fb_map[] with zeroes instead of 1's and fbcon_startup looks for 
fb_info in registered_fb[0] instead of registered_fb[1]

Tony




-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help