[lkml]   [2003]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] crash in pcmcia_access_configuration_register

As promised, here's the patch to fix an oops in the kernel PCMCIA driver.
The patch should be applied both to 2.4 and 2.5 series.

How to reproduce the bug:

1) Compile and install HostAP ( - any recent
version (CVS version is OK).

2) Insert a card supported by HostAP.

3) Remove (physically) the card. The kernel oopses.


While doing a reset, HostAP used AccessConfigurationRegister request to
preserve the value of the configuration register. The reset is triggered
by the removal of the card.

I do believe that HostAP can be improved to avoid reset if the socket
configuration has been released. Nevertheless, oops is not a reputable
behavior when the driver merely requests a configuration register.

The pcmcia-cs driver already has a slightly different protection, but the
following patch is simpler and addresses the problem right before it

--- drivers/pcmcia/cs.c
+++ drivers/pcmcia/cs.c
@@ -882,6 +882,10 @@ int pcmcia_access_configuration_register
c = &s->config[reg->Function];
} else
c = CONFIG(handle);
+ if (c == NULL)
+ return CS_NO_CARD;
if (!(c->state & CONFIG_LOCKED))

Pavel Roskin
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:33    [W:0.020 / U:0.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site