git: 846e4a206fab - main - ktls_disable_ifnet_help: Set curvnet around sorele().

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Wed, 18 Jan 2023 23:39:20 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=846e4a206fabf18b7ace01f6a41f65252da3dd95

commit 846e4a206fabf18b7ace01f6a41f65252da3dd95
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-01-18 23:39:04 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-01-18 23:39:04 +0000

    ktls_disable_ifnet_help: Set curvnet around sorele().
    
    This is required in kernels with VIMAGE such as GENERIC.
    
    MFC after:      1 week
    Sponsored by:   Chelsio Communications
---
 sys/kern/uipc_ktls.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c
index 330a7a2dbdcd..ac55268728e9 100644
--- a/sys/kern/uipc_ktls.c
+++ b/sys/kern/uipc_ktls.c
@@ -3210,7 +3210,9 @@ ktls_disable_ifnet_help(void *context, int pending __unused)
 	}
 
 out:
+	CURVNET_SET(so->so_vnet);
 	sorele(so);
+	CURVNET_RESTORE();
 	if (!in_pcbrele_wlocked(inp))
 		INP_WUNLOCK(inp);
 	ktls_free(tls);