[bug] drivers/char/serial.c causes NULL ptr deref. OOPS w/ pnp guessing

From: David Ford (david@kalifornia.com)
Date: Sun Jun 04 2000 - 10:51:59 EST


(2.4.0-test1-ac7)

Howdy. Something is odd in serial.c. I found this oddity this morning
while running a machine thru the gammut.

Here's a snippet of dmesg output, I added the portion that prints the
"Inside serial..." value.

     Serial driver version 5.01 (2000-05-29) with MANY_PORTS
     SHARE_IRQ SERIAL_PCI ISA
     PNP enabled
     ttyS00 at 0x03f8 (irq = 4) is a 16550A
     ttyS01 at 0x02f8 (irq = 3) is a 16550A
     Entered probe_serial_pnp()
     Inside serial_pnp_guess_board, 00000000 (OPTi Audio 16)
     register_serial(): autoconfig failed
     Inside serial_pnp_guess_board, c11390e0 (OPTi Audio 16)
     Inside serial_pnp_guess_board, c11392c0 (OPTi Audio 16)
     Inside serial_pnp_guess_board, c1139320 (OPTi Audio 16)
     Leaving probe_serial_pnp() (probe finished)

Here's the relevant code with the ">" being lines I added, this is from
drivers/char/serial.c:4900:

     static int _INLINE_ serial_pnp_guess_board(struct pci_dev
     *dev,
                      struct pci_board *board)
     {
            struct isapnp_resources *res = (struct isapnp_resources
     *)dev->sysdata;
            struct isapnp_resources *resa;

> printk("Inside serial_pnp_guess_board, %08lx (%s)\n", res,
     dev->bus->name);
>
            if (!(check_name(dev->name) ||
     check_name(dev->bus->name)) &&
           !(check_compatible_id(dev)))
              return 1;

> if (!res)
> return 0;
>
            if (res->next)
               return 1;

Wowsers. Looks like we need to squash a lil' bugger here. I'm sure my
patch isn't the true and correct way but I didn't have time to go
further on this ;)

More information is available if you wish it. The full dmesg boot
output is available at http://stuph.org/kbug.20000604.

-d

--
"The difference between 'involvement' and 'commitment' is like an
eggs-and-ham breakfast: the chicken was 'involved' - the pig was
'committed'."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:18 EST