HomeFreeBSD

if_ovpn: Destroy cloned interfaces via a prison removal callback

Description

if_ovpn: Destroy cloned interfaces via a prison removal callback

A if_ovpn interface carries a reference to a socket, which has a
credential reference, which holds a reference on the containing prison
and prevents SYSUNINITs from being invoked. So, register a
PR_METHOD_REMOVE callback and destroy the cloner from there instead,
since that mechanism doesn't require the prison refcount to drop to zero
first.

This fixes a bug where jails get left stuck in the DYING state after
running if_ovpn regression tests.

Reviewed by: kp
MFC after: 2 weeks
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D51526

Details

Provenance
markjAuthored on Jul 28 2025, 3:46 PM
Reviewer
kp
Differential Revision
D51526: if_ovpn: Destroy cloned interfaces via a prison removal callback
Parents
rG748a4ea1caff: jail: Make prison_owns_vnet() operate on a prison instead of a ucred
Branches
Unknown
Tags
Unknown