From nobody Thu Nov 07 16:33:19 2024 X-Original-To: dev-commits-src-branches@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 4Xkngg6Bk9z5c6vJ; Thu, 07 Nov 2024 16:33:19 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xkngg5SnDz4HyB; Thu, 7 Nov 2024 16:33:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730997199; 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=qdu0LH9+eg9QGDvB7rS99ikZl5rUhge3bm7b3szY0aY=; b=CSjPViRWNR/bFksF3bW3RwNwN6WAb+YRV90caoGiUlzpiWXpqhnEPJuz/pXF84e3pCuiBb RfaCAWhl85bHNbGrMdn7l0UbA7kn7DX1TYRa3WAj/B6WUMMUXH8anMj+xqPjZtt7Ok3f3w nM7qG2jvbulGj67RW0N5Q7mECCorARMkj5SAmAauDrK+FvjNaoiStViJLjtNI0T+Ur85Ui /BjvoXW97xCaRfSTOAYuMZQuioA39Qu4EjFAt7G4eT0OuoiEjHtTW/gAuyRjMMIoRQ/0oc LrfuDPkp56GM/ab+Y8+GKVTYbDOs/pzZkK4qYQAq2vWpu1x6qUyNtmQv+TMC3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730997199; 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=qdu0LH9+eg9QGDvB7rS99ikZl5rUhge3bm7b3szY0aY=; b=DNvQAdhlOpiM4lk/ckUAoIg21EM/afsiQ0QavLeC9jwSI09WWFiU6XjFqTG2SKNjHZst+6 r1Ci0ITDK/t05gTs5Y2Y+mwLif5IuaIFcBmzTmQi1971zg4oL/qc721HSchpDlcnXdJumJ wACuRKfD02KEifEs96lHIw5ZCYuiIYHhVfnLYdQpkQ2BG7oPqLm1jLeLFSomkV5StXbarA eshVMtf5RHrpvuGP3P3NvWIo40otLuAXhDDXsaXh1NRb7QlLVdPxJq2p9zMOYGd55HKoga +e7b5c9e+/anoelilyMAkbafr4hsMsne6dFmn/c/eW6/i+Feu2NbfPXSYzWhEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730997199; a=rsa-sha256; cv=none; b=RM/BRGwTkn0YXE+q/bGu8SpveZsMzmVP17fCavsGTS30FeH7qlk0cRKSfTAlA8btwrGVUO dv+itqHTj3ZM2r2s6YIfmqnmPMh2ciXiDHLaqJVq4Bm/D6Yo5pWUbExaOjlsuNZs8ysD4W mKi2YcJRuh24BBzyysDl0C1wqNVK9KLvr+m1OU6WyrneWSFMW4gYBfgJN62Z+X4awFQiUJ Yvw5hJ9eLfA0/lsQBBwMpAV9Rciuh1VNrZ2gRpGyhTwGFW/+gOX7iXt55vOn2AcaF1KR1G CDO35J3ZqDgyCosspccfaXD/rUOdER9xn/NtPtQ6zbREiaB1xWdctXKCmqjZBA== 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 4Xkngg5487zt8L; Thu, 7 Nov 2024 16:33:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A7GXJu3072495; Thu, 7 Nov 2024 16:33:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A7GXJVg072491; Thu, 7 Nov 2024 16:33:19 GMT (envelope-from git) Date: Thu, 7 Nov 2024 16:33:19 GMT Message-Id: <202411071633.4A7GXJVg072491@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 5b8e4b1c123e - stable/13 - ifnet: Assert that we are assigning network stack correctly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5b8e4b1c123ec3cb779a5563d672b62be1c94065 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=5b8e4b1c123ec3cb779a5563d672b62be1c94065 commit 5b8e4b1c123ec3cb779a5563d672b62be1c94065 Author: Zhenlei Huang AuthorDate: 2024-10-22 04:32:24 +0000 Commit: Zhenlei Huang CommitDate: 2024-11-07 16:32:16 +0000 ifnet: Assert that we are assigning network stack correctly It makes no sense to assign NULL vnet to an interface when the kernel option VIMAGE is enabled. Add an assertion to catch that. This will also help diagnosing problem report [1] and [2]. 1. https://bugs.freebsd.org/275381 2. https://bugs.freebsd.org/282168 Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46982 (cherry picked from commit d1d839d0b593541174ca48c675c9eff4ddb4715e) (cherry picked from commit 2f3c87296cc727fc21fbb4d549deaed7dfa2fef1) --- sys/net/if.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/net/if.c b/sys/net/if.c index 8a870bb4e1bc..107ff67d547a 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -864,6 +864,7 @@ if_attach_internal(struct ifnet *ifp, bool vmove) ifp->if_xname); #ifdef VIMAGE + CURVNET_ASSERT_SET(); ifp->if_vnet = curvnet; if (ifp->if_home_vnet == NULL) ifp->if_home_vnet = curvnet;