Date: Mon, 23 Jul 2018 17:35:20 +0000 (UTC) From: Dexuan Cui <dexuan@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336643 - stable/11/sys/dev/hyperv/netvsc Message-ID: <201807231735.w6NHZKZn019157@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dexuan Date: Mon Jul 23 17:35:20 2018 New Revision: 336643 URL: https://svnweb.freebsd.org/changeset/base/336643 Log: MFC: 336426 r336426 hyperv/hn: Fix panic in hypervisor code upon device detach event Submitted by: hselasky Reviewed by: dexuan Differential Revision: https://reviews.freebsd.org/D16139 Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 23 17:26:38 2018 (r336642) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 23 17:35:20 2018 (r336643) @@ -1161,6 +1161,13 @@ hn_ismyvf(const struct hn_softc *sc, const struct ifne strcmp(ifp->if_dname, "vlan") == 0) return (false); + /* + * During detach events ifp->if_addr might be NULL. + * Make sure the bcmp() below doesn't panic on that: + */ + if (ifp->if_addr == NULL || hn_ifp->if_addr == NULL) + return (false); + if (bcmp(IF_LLADDR(ifp), IF_LLADDR(hn_ifp), ETHER_ADDR_LEN) != 0) return (false);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807231735.w6NHZKZn019157>