HomeFreeBSD

dummynet: fix ip_dn_vnet_init() / dummynet_task() race

Description

dummynet: fix ip_dn_vnet_init() / dummynet_task() race

If dummynet_task() is run on a vnet where dummynet is still initialising
(i.e. still running ip_dn_vnet_init()) we can attempt to use an
uninitialised mutex.

We can use the existing init_done field to check if the per-vnet
V_dn_cfg is fully set up, if we ensure that it's only set to 1 when
we've done all of the init work.

Reported by: Alfredo Dal'Ava JĂșnior <alfredo@freebsd.org>
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35716

Details

Provenance
kpAuthored on Jul 4 2022, 8:36 PM
Differential Revision
D35716: dummynet: fix ip_dn_vnet_init() / dummynet_task() race
Parents
rG9576bca5834b: OpenSSL: Regen assembly file for OpenSSSL 1.1.1q
Branches
Unknown
Tags
Unknown