HomeFreeBSD

dummynet: do not store struct ifnet pointers

Description

dummynet: do not store struct ifnet pointers

The dn_pkt_tag tag contained a struct ifnet pointer. If we persist that
across NET_EPOCH boundaries (as we did in dummynet) we risk panics if
the interface is removed between the packet being enqueued and it being
dequeued.

Convert the pointer into an index/generation pair and restore it when
the packet is taken out of the queue.

Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35256

Details

Provenance
kpAuthored on May 19 2022, 1:12 PM
Differential Revision
D35256: dummynet: do not store struct ifnet pointers
Parents
rGeca368ecb6e0: Retire sv_transtrap
Branches
Unknown
Tags
Unknown