Thread (5 messages) flat view 5 messages, 2 authors, 2010-01-13

potential overflow in de4x5.c

From: Dan Carpenter <hidden>
Date: 2010-01-03 10:14:25

Hi I found this using smatch (http://repo.or.cz/w/smatch.git).

drivers/net/tulip/de4x5.c
  4772          lp->active = *p++;
  4773          if (MOTO_SROM_BUG) lp->active = 0;
  4774          lp->phy[lp->active].gep = (*p ? p : NULL); p += (2 * (*p) + 1);

lp->phy is an array of size 8.

MOTO_SROM_BUG is defined like this. 

#define MOTO_SROM_BUG    (lp->active == 8 && (get_unaligned_le32(dev->dev_addr) & 0x00ffffff) == 0x3e0008)

If lp->active == 8 then we have a buffer overflow.

regards,
dan carpenter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help