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

From: Hennerich, Michael
Date: Mon May 21 2007 - 08:07:30 EST


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@xxxxxxxxxx
** ***** Systems Engineering
** ** Wilhelm-Wagenfeld-Strasse 6
** ***** D-80807 Munich
********* Germany
Registergericht München HRB 40368, Geschäftsführer: Thomas Wessel, William A. Martin, Margaret Seif

>-----Original Message-----
>From: penberg@xxxxxxxxx [mailto:penberg@xxxxxxxxx] On Behalf Of Pekka
>Enberg
>Sent: Montag, 21. Mai 2007 13:40
>To: Bryan Wu
>Cc: torvalds@xxxxxxxxxxxxxxxxxxxx; akpm@xxxxxxxxxxxxxxxxxxxx; linux-
>kernel@xxxxxxxxxxxxxxx; Michael Hennerich
>Subject: Re: [PATCH 12/32] Blackfin arch: Fix bug using usb keyboard
>crashes kernel
>
>Hi Bryan,
>
>On 5/21/07, Bryan Wu <bryan.wu@xxxxxxxxxx> wrote:
>> +#ifdef CONFIG_DUMMY_CONSOLE
>> + conswitchp = &dummy_con;
>> +#endif
>> cclk = get_cclk();
>> sclk = get_sclk();
>
>This patch has no changelog. While it is probably apparent to you why
>this fixes a crash when using an USB keyboard, it would be nice for
>the rest of us to know which crash it fixes and why.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/