Author: sephe
Date: Mon Sep  5 03:39:04 2016
New Revision: 305407
URL: https://svnweb.freebsd.org/changeset/base/305407

Log:
  hyperv/hn: Stringent NVS notification length check.
  
  MFC after:    1 week
  Sponsored by: Microsoft
  Differential Revision:        https://reviews.freebsd.org/D7753

Modified:
  head/sys/dev/hyperv/netvsc/hv_net_vsc.c

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c     Mon Sep  5 03:37:28 2016        
(r305406)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c     Mon Sep  5 03:39:04 2016        
(r305407)
@@ -816,7 +816,12 @@ hn_proc_notify(struct hn_softc *sc, cons
 {
        const struct hn_nvs_hdr *hdr;
 
+       if (VMBUS_CHANPKT_DATALEN(pkt) < sizeof(*hdr)) {
+               if_printf(sc->hn_ifp, "invalid nvs notify\n");
+               return;
+       }
        hdr = VMBUS_CHANPKT_CONST_DATA(pkt);
+
        if (hdr->nvs_type == HN_NVS_TYPE_TXTBL_NOTE) {
                /* Useless; ignore */
                return;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to