HomeFreeBSD

iflib: Free resources in a consistent order during detach

Description

iflib: Free resources in a consistent order during detach

Memory and PCI resources are freed with no particular order. This could
cause use-after-frees when detaching following a failed attach. For
instance, iflib_tx_structures_free() frees ctx->ifc_txqs[] but
iflib_tqg_detach() attempts to access this array. Similarly, adapter
queues gets freed by IFDI_QUEUES_FREE() but IFDI_DETACH() attempts to
access adapter queues to free PCI resources.

MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D27634

Details

Provenance
stallamr_netapp.comAuthored on Feb 1 2021, 4:13 PM
markjCommitted on Feb 1 2021, 4:15 PM
Differential Revision
D27634: Ensure to free memory and pci resources in order
Parents
R10:45ecda8ebf80: stand/amd64: remove unused addr parameter from bi_load64
Branches
Unknown
Tags
Unknown