From nobody Sat Mar 19 19:20:02 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A354D1A1EC4F; Sat, 19 Mar 2022 19:20:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KLW0y48llz4sC7; Sat, 19 Mar 2022 19:20:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647717602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4lP7Ax9a0Hjos4p8WAJUSg3+nD3rvpdezMYiinkIAqE=; b=aqabgFfhVPyByP6EGebBaij91FvWrFqtvxVrdNhMioibGsj4kt4EjDilW/DELxCrMcKW2W NIfKTMWxdMLW5gl3cQF+Pi3hhJ/zAUtF38gTYVUAYhLywF7bEQoewYntNj/vCsrj8YeR9H IiHgZz2SfRw2jMcjy2PMqrF4rvYx3N6ZANn1Qpnlf0j730CXyykxT0Fdb4TQeyn53M02vR hBfWgCaAsFGLHhmcGJPAtCDWyw7uzpWviXHLUUjsNVAWcpsNZEGhC3EDAyEji1m/cPm6PI 5IXL66nDG7x11vBKcnztuxW8/QFwLHazuNAXWDePR21fq1PdWvdIDTUibx9+Ng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F4C518CE2; Sat, 19 Mar 2022 19:20:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 22JJK2D3015696; Sat, 19 Mar 2022 19:20:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22JJK2JI015693; Sat, 19 Mar 2022 19:20:02 GMT (envelope-from git) Date: Sat, 19 Mar 2022 19:20:02 GMT Message-Id: <202203191920.22JJK2JI015693@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Neel Chauhan Subject: git: b1d24b891bba - main - emulators/virtualbox-ose-kmod: Fix kernel panic in DHCP bridge mode List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b1d24b891bbadf165edf477b98d61d407144208c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647717602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4lP7Ax9a0Hjos4p8WAJUSg3+nD3rvpdezMYiinkIAqE=; b=fpuvT5SAQNbEzegY/tE0M3jKmNiPAbiyYhTrvilRbiz6OAqtqYM04xc0AXNXIdRR/dTLnD ObJKhKL6bxqNrJCCpdrHIMTN+is5/DpXrpF7p4mV7MqHgz0JrIBohGvjO/+0RB9R2jI8NX Nrr3x0GvBavz31jR9HaXDOViEt6oiaSjgAOwLow6fhcGeKgmeFYcIkTnd6Wydx4UqVAw36 CckFziXX4zwmkXh/tg3FFjOjeMRGoas204PTux10DJ68eldGgbV+DaApVQI0xt0cQPV4CD 8D9zUbfSU05VjDOkTvL3Z/ZImu+392Yusk4Z7/kLYRO8vOyWbEEgGb/nOdxg7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647717602; a=rsa-sha256; cv=none; b=OM6jP5k9GDjRunW3CGAmbl6u2QshwOs6d3h2f6Ozj+++42PKbEJDHvrIUUgcWejtjzupUb lwTTGN4DnOE8UQLxPz2tyDGDk5KsJKDTjXXNibrBjdROHifI4eDF0SZXho+M7SGMRUORPC qawM0eLPTnIIQHgxnSsuvdp3JEmRaph9ScJDjLxBTyPCV81rmB+GTqN8WQ+eQv3rCpFBbL Kdjfh8TRGKj90cSoxc9r/jWOqi8IlVLFLtg6eEjHgrlSptQlFiEmtlm0YGSUff1/c6Eds3 SKDl2Jipmb/NhaLMWM240d4w4zILzqScTLbmR3drBk+bcerbSUuNLq6zH0yD6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by nc: URL: https://cgit.FreeBSD.org/ports/commit/?id=b1d24b891bbadf165edf477b98d61d407144208c commit b1d24b891bbadf165edf477b98d61d407144208c Author: Neel Chauhan AuthorDate: 2022-03-19 19:18:19 +0000 Commit: Neel Chauhan CommitDate: 2022-03-19 19:19:59 +0000 emulators/virtualbox-ose-kmod: Fix kernel panic in DHCP bridge mode PR: 262656 Approved by: madpilot --- emulators/virtualbox-ose-kmod/Makefile | 1 + ...Drivers_VBoxNetFlt_freebsd_VBoxNetFlt-freebsd.c | 40 ++++++++++++++-------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/emulators/virtualbox-ose-kmod/Makefile b/emulators/virtualbox-ose-kmod/Makefile index d917ba0a54f4..e82557638d13 100644 --- a/emulators/virtualbox-ose-kmod/Makefile +++ b/emulators/virtualbox-ose-kmod/Makefile @@ -2,6 +2,7 @@ PORTNAME= virtualbox-ose PORTVERSION= 6.1.32 +PORTREVISION= 1 CATEGORIES= emulators MASTER_SITES= https://download.virtualbox.org/virtualbox/${PORTVERSION}/ PKGNAMESUFFIX= -kmod diff --git a/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_VBoxNetFlt-freebsd.c b/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_VBoxNetFlt-freebsd.c index 25df12a1546e..8a0d8663d046 100644 --- a/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_VBoxNetFlt-freebsd.c +++ b/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_VBoxNetFlt-freebsd.c @@ -1,4 +1,4 @@ ---- src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c.orig 2021-04-28 16:31:54 UTC +--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c.orig 2022-01-13 18:57:38 UTC +++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c @@ -52,6 +52,7 @@ #include @@ -16,7 +16,7 @@ static int vboxnetflt_modevent(struct module *, int, void *); static ng_constructor_t ng_vboxnetflt_constructor; -@@ -149,6 +151,7 @@ NETGRAPH_INIT(vboxnetflt, &ng_vboxnetflt_typestruct); +@@ -149,6 +151,7 @@ MODULE_DEPEND(ng_vboxnetflt, vboxdrv, 1, 1, 1); */ MODULE_VERSION(vboxnetflt, 1); MODULE_DEPEND(ng_vboxnetflt, vboxdrv, 1, 1, 1); @@ -118,7 +118,7 @@ } vboxNetFltRelease(pThis, true /* fBusy */); VBOXCURVNET_RESTORE(); -@@ -521,6 +573,7 @@ static void vboxNetFltFreeBSDoutput(void *arg, int pen +@@ -521,6 +573,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p */ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *pvIfData, PINTNETSG pSG, uint32_t fDst) { @@ -168,15 +168,25 @@ return VERR_NO_MEMORY; } -@@ -574,6 +640,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p +@@ -571,9 +637,17 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p + m_tag_prepend(m, mtag); + m->m_flags |= M_PKTHDR; + m->m_pkthdr.rcvif = ifp; ++#if __FreeBSD_version >= 1300049 ++ struct epoch_tracker et; ++ NET_EPOCH_ENTER(et); ++#endif ifp->if_input(ifp, m); ++#if __FreeBSD_version >= 1300049 ++ NET_EPOCH_EXIT(et); ++#endif } VBOXCURVNET_RESTORE(); + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } -@@ -586,6 +653,7 @@ static bool vboxNetFltFreeBsdIsPromiscuous(PVBOXNETFLT +@@ -586,6 +660,7 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, void *pvContext) { @@ -184,7 +194,7 @@ char nam[NG_NODESIZ]; struct ifnet *ifp; node_p node; -@@ -594,7 +662,10 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi +@@ -594,7 +669,10 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi NOREF(pvContext); ifp = ifunit(pThis->szName); if (ifp == NULL) @@ -195,7 +205,7 @@ /* Create a new netgraph node for this instance */ if (ng_make_node_common(&ng_vboxnetflt_typestruct, &node) != 0) -@@ -638,12 +709,14 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi +@@ -638,12 +716,14 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi vboxNetFltRelease(pThis, true /*fBusy*/); } VBOXCURVNET_RESTORE(); @@ -210,7 +220,7 @@ struct ifnet *ifp, *ifp0; ifp = ASMAtomicUoReadPtrT(&pThis->u.s.ifp, struct ifnet *); -@@ -660,6 +733,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi +@@ -660,6 +740,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi pThis->u.s.node = NULL; } VBOXCURVNET_RESTORE(); @@ -218,7 +228,7 @@ if (ifp0 != NULL) { -@@ -672,6 +746,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi +@@ -672,6 +753,7 @@ void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis) void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis) { @@ -226,7 +236,7 @@ taskqueue_drain(taskqueue_fast, &pThis->u.s.tskin); taskqueue_drain(taskqueue_fast, &pThis->u.s.tskout); -@@ -684,6 +759,7 @@ void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis) +@@ -684,6 +766,7 @@ void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis) ng_rmnode_self(pThis->u.s.node); VBOXCURVNET_RESTORE(); pThis->u.s.node = NULL; @@ -234,7 +244,7 @@ } int vboxNetFltOsPreInitInstance(PVBOXNETFLTINS pThis) -@@ -697,6 +773,7 @@ int vboxNetFltOsPreInitInstance(PVBOXNETFLTINS pThis) +@@ -697,6 +780,7 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, bool fActive) { @@ -242,7 +252,7 @@ struct ifnet *ifp; struct ifreq ifreq; int error; -@@ -730,7 +807,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b +@@ -730,7 +814,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_CONNECT, sizeof(struct ngm_connect), M_NOWAIT); if (msg == NULL) @@ -253,7 +263,7 @@ con = (struct ngm_connect *)msg->data; snprintf(con->path, NG_PATHSIZ, "vboxnetflt_%s:", ifp->if_xname); strlcpy(con->ourhook, "lower", NG_HOOKSIZ); -@@ -744,7 +824,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b +@@ -744,7 +831,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_CONNECT, sizeof(struct ngm_connect), M_NOWAIT); if (msg == NULL) @@ -264,7 +274,7 @@ con = (struct ngm_connect *)msg->data; snprintf(con->path, NG_PATHSIZ, "vboxnetflt_%s:", ifp->if_xname); -@@ -767,7 +850,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b +@@ -767,7 +857,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_RMHOOK, sizeof(struct ngm_rmhook), M_NOWAIT); if (msg == NULL) @@ -275,7 +285,7 @@ rm = (struct ngm_rmhook *)msg->data; strlcpy(rm->ourhook, "input", NG_HOOKSIZ); NG_SEND_MSG_PATH(error, node, msg, path, 0); -@@ -778,12 +864,16 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b +@@ -778,12 +871,16 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_RMHOOK, sizeof(struct ngm_rmhook), M_NOWAIT); if (msg == NULL)