mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Check that the received packet length indicated by the card is at least
large enough to contain the ethernet header. There appears to be a condition where the card can return "0" in some failure cases, and this causes bad things to happen (a panic).
This commit is contained in:
parent
804974bacc
commit
0633918017
2 changed files with 10 additions and 2 deletions
|
|
@ -24,7 +24,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_fxp.c,v 1.32 1997/03/24 11:33:46 bde Exp $
|
||||
* $Id: if_fxp.c,v 1.33 1997/03/25 14:54:38 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
@ -634,6 +634,10 @@ rcvloop:
|
|||
u_short total_len;
|
||||
|
||||
total_len = rfa->actual_size & (MCLBYTES - 1);
|
||||
if (total_len < sizeof(struct ether_header)) {
|
||||
m_freem(m);
|
||||
goto rcvloop;
|
||||
}
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
m->m_pkthdr.len = m->m_len = total_len -
|
||||
sizeof(struct ether_header);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_fxp.c,v 1.32 1997/03/24 11:33:46 bde Exp $
|
||||
* $Id: if_fxp.c,v 1.33 1997/03/25 14:54:38 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
@ -634,6 +634,10 @@ rcvloop:
|
|||
u_short total_len;
|
||||
|
||||
total_len = rfa->actual_size & (MCLBYTES - 1);
|
||||
if (total_len < sizeof(struct ether_header)) {
|
||||
m_freem(m);
|
||||
goto rcvloop;
|
||||
}
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
m->m_pkthdr.len = m->m_len = total_len -
|
||||
sizeof(struct ether_header);
|
||||
|
|
|
|||
Loading…
Reference in a new issue