Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Correct lower bound of RX packet length; don't f...



details:   https://anonhg.NetBSD.org/src/rev/080d4a9b15bb
branches:  trunk
changeset: 433465:080d4a9b15bb
user:      rin <rin%NetBSD.org@localhost>
date:      Sun Sep 16 01:13:26 2018 +0000

description:
Correct lower bound of RX packet length; don't forget FCS.

diffstat:

 sys/dev/usb/if_mue.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 83a1e82c1527 -r 080d4a9b15bb sys/dev/usb/if_mue.c
--- a/sys/dev/usb/if_mue.c      Sun Sep 16 01:07:38 2018 +0000
+++ b/sys/dev/usb/if_mue.c      Sun Sep 16 01:13:26 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_mue.c,v 1.9 2018/09/16 01:07:38 rin Exp $   */
+/*     $NetBSD: if_mue.c,v 1.10 2018/09/16 01:13:26 rin Exp $  */
 /*     $OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $  */
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.9 2018/09/16 01:07:38 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.10 2018/09/16 01:13:26 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1476,7 +1476,7 @@
                if (sc->mue_flags & LAN7500)
                        pktlen -= 2;
 
-               if (__predict_false(pktlen < ETHER_HDR_LEN ||
+               if (__predict_false(pktlen < ETHER_HDR_LEN + ETHER_CRC_LEN ||
                    pktlen > MCLBYTES - ETHER_ALIGN ||
                    pktlen + sizeof(*hdrp) > total_len)) {
                        MUE_PRINTF(sc, "invalid packet length %d\n", pktlen);



Home | Main Index | Thread Index | Old Index