Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Dec 2020 11:03:54 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r368801 - head/sys/dev/usb/net
Message-ID:  <202012191103.0BJB3sqJ057970@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012191103.0BJB3sqJ057970>