Re: [PATCH 12/32] Blackfin arch: Fix bug using usb keyboard crashes kernel

Previous thread: Please pull git390 'for-linus' branch by Martin Schwidefsky on Monday, May 21, 2007 - 4:16 am. (1 message)

Next thread: man-pages-2.49 and man-pages-2.50 are released by Michael Kerrisk on Monday, May 21, 2007 - 4:58 am. (1 message)
From: Hennerich, Michael
Date: Monday, May 21, 2007 - 5:07 am

I was fixing this issue some time ago.

With CONFIG_VT (drivers/char/vt.c) enabled and a USB HID keyboard connected, we were seeing bad pointer dereferences in drivers/char/keyboard.c

In function kbd_keycode vc_cons[fg_console].d was un-initialized .

static void kbd_keycode(unsigned int keycode, int down, int hw_raw)
{
--snip--
	struct vc_data *vc = vc_cons[fg_console].d;

--snip--
	tty = vc->vc_tty;
--snip--
}	

The workaround, almost any arch does is to initialize conswitchp with the dummy console.

conswitchp = &dummy_con;	

The dummy console gets automatically selected if there is no other suitable console (VGA).
The bit we were missing is simply this fix.

Best regards,
Michael


------------------------------------------------------------------
********* Analog Devices GmbH         michael.hennerich@analog.com
**  *****                                      Systems Engineering
**     ** Wilhelm-Wagenfeld-Strasse 6       
**  ***** D-80807 Munich                      
********* Germany                          
-

From: Pekka Enberg
Date: Monday, May 21, 2007 - 5:14 am

[snip]

Makes sense. Please consider adding this to the changelog. Thanks.

                        Pekka
-

From: Pekka Enberg
Date: Monday, May 21, 2007 - 5:50 am

I am not an expert on this, but I don't see how vc_cons[fg_console].d
would be uninitialized. It is always set in
drivers/char/vt.c:con_init() and drivers/char/vt.c:vc_allocate(). The
conswitchp change affects vc->vc_sw but I don't see that being used in
drivers/char/keyboard.c:kbd_keycode() except indirectly via
set_console et al.

Perhaps I am missing something here?
-

Previous thread: Please pull git390 'for-linus' branch by Martin Schwidefsky on Monday, May 21, 2007 - 4:16 am. (1 message)

Next thread: man-pages-2.49 and man-pages-2.50 are released by Michael Kerrisk on Monday, May 21, 2007 - 4:58 am. (1 message)