From owner-dev-commits-src-all@freebsd.org Sun Mar 28 19:04:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0FD635AAA51; Sun, 28 Mar 2021 19:04:14 +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 4F7lW16XRsz3FWP; Sun, 28 Mar 2021 19:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 D32AD25465; Sun, 28 Mar 2021 19:04:13 +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 12SJ4D88062519; Sun, 28 Mar 2021 19:04:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12SJ4D4x062518; Sun, 28 Mar 2021 19:04:13 GMT (envelope-from git) Date: Sun, 28 Mar 2021 19:04:13 GMT Message-Id: <202103281904.12SJ4D4x062518@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brandon Bergren Subject: git: 98727c6cd11e - main - Fix panic when using BOOTP to resolve root path. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdragon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98727c6cd11edb10617be0f421e485e0223185a5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2021 19:04:14 -0000 The branch main has been updated by bdragon: URL: https://cgit.FreeBSD.org/src/commit/?id=98727c6cd11edb10617be0f421e485e0223185a5 commit 98727c6cd11edb10617be0f421e485e0223185a5 Author: Brandon Bergren AuthorDate: 2021-03-28 00:18:51 +0000 Commit: Brandon Bergren CommitDate: 2021-03-28 19:02:40 +0000 Fix panic when using BOOTP to resolve root path. When loading a direct-boot kernel, a temporary route is being installed, the NFS handle is acquired, and the temporary route is removed again. This was being done inside a net epoch, but since the krpc code is written using blocking APIs, we can't actually do that, because sleeping is not allowed during a net epoch. Exit and reenter the epoch so we are only in the epoch when doing the routing table manipulation. Fixes panic when booting my RB800 over NFS (where the kernel is loaded using RouterBOOT directly.) Reviewed by: melifaro Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D29464 --- sys/nfs/bootp_subr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/nfs/bootp_subr.c b/sys/nfs/bootp_subr.c index fd0e0653a02c..2386a23084da 100644 --- a/sys/nfs/bootp_subr.c +++ b/sys/nfs/bootp_subr.c @@ -1682,9 +1682,11 @@ retry: NET_EPOCH_ENTER(et); bootpc_add_default_route(ifctx); + NET_EPOCH_EXIT(et); error = md_mount(&nd->root_saddr, nd->root_hostnam, nd->root_fh, &nd->root_fhsize, &nd->root_args, td); + NET_EPOCH_ENTER(et); bootpc_remove_default_route(ifctx); NET_EPOCH_EXIT(et); if (error != 0) {