svn commit: r368801 - head/sys/dev/usb/net

Hans Petter Selasky hselasky at FreeBSD.org
Sat Dec 19 11:03:55 UTC 2020


Author: hselasky
Date: Sat Dec 19 11:03:54 2020
New Revision: 368801
URL: https://svnweb.freebsd.org/changeset/base/368801

Log:
  Ensure a minimum packet length before creating a mbuf in if_ure.
  
  Sponsored by:	Mellanox Technologies // NVIDIA Networking

Modified:
  head/sys/dev/usb/net/if_ure.c

Modified: head/sys/dev/usb/net/if_ure.c
==============================================================================
--- head/sys/dev/usb/net/if_ure.c	Sat Dec 19 11:03:04 2020	(r368800)
+++ head/sys/dev/usb/net/if_ure.c	Sat Dec 19 11:03:54 2020	(r368801)
@@ -711,7 +711,7 @@ ure_bulk_read_callback(struct usb_xfer *xfer, usb_erro
 				goto tr_setup;
 			}
 
-			if (len != 0)
+			if (len >= (ETHER_HDR_LEN + ETHER_CRC_LEN))
 				m = ure_makembuf(pc, off, len - ETHER_CRC_LEN);
 			else
 				m = NULL;


More information about the svn-src-head mailing list