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

(cherry picked from commit 96b29c7f0cffd377a757ad8ccc0cdd8fcb96d0dd)

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
rG5c37f7d22fa7: wordexp(3): Handle ECHILD from waitpid
Branches
Unknown
Tags
Unknown