enc28j60: fix RX buffer overflow
authorBaruch Siach <baruch@tkos.co.il>
Mon, 5 Jan 2009 00:23:01 +0000 (16:23 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Oct 2009 15:11:43 +0000 (08:11 -0700)
commit52ccbcd1bcbed712bb586c3c17164fe326e89f1a
tree8e0da7ede020a51fe626959282602214885991af
parente6edca0908edee83e00c90a904c5ecaf9d0e5404
enc28j60: fix RX buffer overflow

commit 22692018b93f0782cda5a843cecfffda1854eb8d upstream.

The enc28j60 driver doesn't check whether the length of the packet as reported
by the hardware fits into the preallocated buffer. When stressed, the hardware
may report insanely large packets even tough the "Receive OK" bit is set. Fix
this.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/enc28j60.c