mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 00/32] Blackfin update for 2.6.22-rc2
@ 2007-05-21 10:09 Bryan Wu
  2007-05-21 10:09 ` [PATCH 01/32] Blackfin arch: Add Workaround for ANOMALY 05000257 Bryan Wu
                   ` (31 more replies)
  0 siblings, 32 replies; 48+ messages in thread
From: Bryan Wu @ 2007-05-21 10:09 UTC (permalink / raw)
  To: torvalds, akpm, linux-kernel

Lots of update for 2.6.22-rc2 and tested on STAMP537 board.


^ permalink raw reply	[flat|nested] 48+ messages in thread
* RE: [PATCH 12/32] Blackfin arch: Fix bug using usb keyboard crashes kernel
@ 2007-05-21 12:07 Hennerich, Michael
  2007-05-21 12:14 ` Pekka Enberg
  0 siblings, 1 reply; 48+ messages in thread
From: Hennerich, Michael @ 2007-05-21 12:07 UTC (permalink / raw)
  To: Pekka Enberg, Bryan Wu; +Cc: torvalds, akpm, linux-kernel, Michael Hennerich

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                          
Registergericht München HRB 40368,  Geschäftsführer:  Thomas Wessel, William A. Martin, Margaret Seif

>-----Original Message-----
>From: penberg@gmail.com [mailto:penberg@gmail.com] On Behalf Of Pekka
>Enberg
>Sent: Montag, 21. Mai 2007 13:40
>To: Bryan Wu
>Cc: torvalds@linux-foundation.org; akpm@linux-foundation.org; linux-
>kernel@vger.kernel.org; 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@analog.com> 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.

^ permalink raw reply	[flat|nested] 48+ messages in thread
* RE: [PATCH 12/32] Blackfin arch: Fix bug using usb keyboard crashes kernel
@ 2007-05-21 13:49 Hennerich, Michael
  2007-05-21 13:54 ` Pekka Enberg
  0 siblings, 1 reply; 48+ messages in thread
From: Hennerich, Michael @ 2007-05-21 13:49 UTC (permalink / raw)
  To: Pekka Enberg, Hennerich, Michael; +Cc: Bryan Wu, torvalds, akpm, linux-kernel

I'm also not an expert...
  
But without conswitchp preset (potential fix):

During initcalls: con_init is called, and returns because of
!display_desc.

static int __init con_init(void)
{
	const char *display_desc = NULL;
	struct vc_data *vc;
	unsigned int currcons = 0, i;

	acquire_console_sem();

	if (conswitchp)
		display_desc = conswitchp->con_startup();
	if (!display_desc) {
		fg_console = 0;
		release_console_sem();
		return 0; // RETURNS HERE
	}

--snip--

}

At this point there is no memory allocated for vc_cons[].d
A bit later vty_init calls kbd_init.

int __init vty_init(void)
{

--snip--
	kbd_init();
--snip--

}

>From now on events are passed to kbd_event which will then call
kbd_keycode.
I don't see where vc_cons[].d in between there is initialized.
 

>-----Original Message-----
>From: penberg@gmail.com [mailto:penberg@gmail.com] On Behalf Of Pekka
>Enberg
>Sent: Montag, 21. Mai 2007 14:51
>To: Hennerich, Michael
>Cc: Bryan Wu; torvalds@linux-foundation.org; akpm@linux-foundation.org;
>linux-kernel@vger.kernel.org
>Subject: Re: [PATCH 12/32] Blackfin arch: Fix bug using usb keyboard
>crashes kernel
>
>On 5/21/07, Hennerich, Michael <Michael.Hennerich@analog.com> wrote:
>> 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.
>
>On 5/21/07, Pekka Enberg <penberg@cs.helsinki.fi> wrote:
>> Makes sense. Please consider adding this to the changelog. Thanks.
>
>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?

^ permalink raw reply	[flat|nested] 48+ messages in thread

end of thread, other threads:[~2007-05-23  1:07 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-21 10:09 [PATCH 00/32] Blackfin update for 2.6.22-rc2 Bryan Wu
2007-05-21 10:09 ` [PATCH 01/32] Blackfin arch: Add Workaround for ANOMALY 05000257 Bryan Wu
2007-05-21 10:09 ` [PATCH 02/32] Blackfin arch: add SPI MMC driver support on bf533-stamp, tested on STAMP-BF533 Bryan Wu
2007-05-21 10:09 ` [PATCH 03/32] Blackfin arch: ISP1761 doesn't work for USB flash disk Bryan Wu
2007-05-21 10:09 ` [PATCH 04/32] Blackfin arch: fix a few random warnings Bryan Wu
2007-05-21 10:09 ` [PATCH 05/32] Blackfin arch: Add configuration data for ISP176x on BF561 Bryan Wu
2007-05-21 10:09 ` [PATCH 06/32] Blackfin arch: mark a bunch of local functions as static Bryan Wu
2007-05-21 10:09 ` [PATCH 07/32] Blackfin arch: Fix reserved map after we changed PORT_H definition Bryan Wu
2007-05-21 10:09 ` [PATCH 08/32] Blackfin arch: Move write to VR_CTL closer to IDLE Bryan Wu
2007-05-21 10:09 ` [PATCH 09/32] Blackfin arch: DMA operation cleanup Bryan Wu
2007-05-21 10:09 ` [PATCH 10/32] Blackfin arch: GPIO fix some defines Bryan Wu
2007-05-21 10:09 ` [PATCH 11/32] Blackfin arch: fix trace output for FLAT binaries Bryan Wu
2007-05-21 10:09 ` [PATCH 12/32] Blackfin arch: Fix bug using usb keyboard crashes kernel Bryan Wu
2007-05-21 11:39   ` Pekka Enberg
2007-05-21 10:09 ` [PATCH 13/32] Blackfin arch: initial tepla-bf561 board support Bryan Wu
2007-05-21 10:09 ` [PATCH 14/32] Blackfin arch: make sure we declare the revid functions as pure (since they are) Bryan Wu
2007-05-21 10:09 ` [PATCH 15/32] Blackfin arch: dont clear status register bits in SWRST so we can actually use it Bryan Wu
2007-05-21 10:09 ` [PATCH 16/32] Blackfin arch: finish removing p* volatile defines for MMRs Bryan Wu
2007-05-21 10:09 ` [PATCH 17/32] Blackfin arch: move board specific setup out of common init code and into the board specific init code Bryan Wu
2007-05-21 10:09 ` [PATCH 18/32] Blackfin arch: issue reset via SWRST so we dont clobber the watchdog state Bryan Wu
2007-05-21 10:09 ` [PATCH 19/32] Blackfin arch: document why we have to touch the UART peripheral in our boot up code Bryan Wu
2007-05-21 10:09 ` [PATCH 20/32] Blackfin arch: dma_memcpy borken for > 64K Bryan Wu
2007-05-21 11:26   ` Pekka Enberg
2007-05-21 17:49     ` Mike Frysinger
2007-05-21 10:09 ` [PATCH 21/32] Blackfin arch: dont clear the bit that tells coreb to start booting Bryan Wu
2007-05-21 10:09 ` [PATCH 22/32] Blackfin arch: make sure we use local labels Bryan Wu
2007-05-21 10:09 ` [PATCH 24/32] Blackfin arch: cache SWRST value at bootup so other things like watchdog can non-destructively query it Bryan Wu
2007-05-21 10:09 ` [PATCH 25/32] Blackfin arch: fix signal handling bug Bryan Wu
2007-05-21 10:09 ` [PATCH 26/32] Blackfin arch: Change NO_ACCESS_CHECK to ACCESS_CHECK Bryan Wu
2007-05-21 10:09 ` [PATCH 27/32] Blackfin arch: add board default configs to blackfin arch Bryan Wu
2007-05-21 10:09 ` [PATCH 28/32] Blackfin arch: update defconfig files Bryan Wu
2007-05-21 10:09 ` [PATCH 29/32] Blackfin arch: update pm.c according to power management API change Bryan Wu
2007-05-21 10:09 ` [PATCH 30/32] Blackfin serial driver: fix overhead issue Bryan Wu
2007-05-21 10:09 ` [PATCH 31/32] Blackfin serial driver: implement support for ignoring parity/break errors Bryan Wu
2007-05-21 10:09 ` Bryan Wu
2007-05-21 14:35 ` [PATCH 00/32] Blackfin update for 2.6.22-rc2 Robin Getz
2007-05-21 14:37   ` Paul Mundt
2007-05-23  0:28     ` Mike Frysinger
2007-05-23  1:06       ` Paul Mundt
2007-05-21 17:36   ` Mike Frysinger
2007-05-21 21:52     ` Robin Getz
2007-05-21 22:01       ` Mike Frysinger
2007-05-22  8:37       ` Bryan Wu
2007-05-21 12:07 [PATCH 12/32] Blackfin arch: Fix bug using usb keyboard crashes kernel Hennerich, Michael
2007-05-21 12:14 ` Pekka Enberg
2007-05-21 12:50   ` Pekka Enberg
2007-05-21 13:49 Hennerich, Michael
2007-05-21 13:54 ` Pekka Enberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome