HomeFreeBSD

domain: make it safer to add domains post-domainfinalize

Description

domain: make it safer to add domains post-domainfinalize

I can see two concerns for adding domains after domainfinalize:

1.) The slow/fast callouts have already been setup.
2.) Userland could create a socket while we're in the middle of

initialization.

We can address #1 fairly easily by tracking whether the domain's been
initialized for at least the default vnet. There are still some concerns
about the callbacks being invoked while a vnet is in the process of
being created/destroyed, but this is a pre-existing issue that the
callbacks must coordinate anyways.

We should also address #2, but technically this has been an issue
anyways because we don't assert on post-domainfinalize additions; we
don't seem to hit it in practice.

Future work can fix that up to make sure we don't find partially
constructed domains, but care must be taken to make sure that at least,
e.g., the usages of pffindproto in ip_input.c can still find them.

Differential Revision: https://reviews.freebsd.org/D25459

Details

Provenance
kevansAuthored on Jun 26 2020, 2:38 AM
Differential Revision
D25459: domain: make it safer to add domains post-domainfinalize
Parents
rG625932c9aa2c: hvsock: fail the probe on non-HyperV machines
Branches
Unknown
Tags
Unknown