HomeFreeBSD

ifnet: Fix decreasing the vnet interface count

Description

ifnet: Fix decreasing the vnet interface count

It should be decreased only when the interface has been successfully
removed from the "active" list.

This prevents vnet_if_return() from potential OOB writes to the
allocated memory "pending".

Reviewed by: kp, pouria
Fixes: a779388f8bb3 if: Protect V_ifnet in vnet_if_return()
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D55873

(cherry picked from commit 8065ff63c0e5c3bb4abb02f55b20cb47bb51d1a7)
(cherry picked from commit 1b7687f053afcf251ee7643ee5a4f22a225f4a02)

Details

Provenance
zleiAuthored on Mar 16 2026, 4:20 PM
Reviewer
rGa779388f8bb3: if: Protect V_ifnet in vnet_if_return()
Differential Revision
D55873: ifnet: Fix decreasing the vnet interface count
Parents
rGfa5f0d95be25: amd64: Make start_all_aps() static
Branches
Unknown
Tags
Unknown