diff options
author | mvs <mvs@cvs.openbsd.org> | 2020-10-03 00:23:56 +0000 |
---|---|---|
committer | mvs <mvs@cvs.openbsd.org> | 2020-10-03 00:23:56 +0000 |
commit | abeb3688fa2815e2090f8bea8d5e44741cd244eb (patch) | |
tree | 3505757aea1a915ecdfd0ff8053936aa19b15257 /sys/net/if_tun.h | |
parent | 698b3ef75ae663b0942612b4aad7e926369ecb61 (diff) |
Introduce `if_cloners_lock' rwlock and use it to serialize
if_clone_{create,destroy}(). This fixes the races described below.
if_clone_{create,destroy}() are kernel locked, but since they touch
various sleep points introduced by rwlocks and M_WAITOK allocations,
without serialization they can intersect due to race condition.
The avoided races are:
1. While performing if_clone_create(), concurrent thread which performing
if_clone_create() can attach `ifp' with the same `if_xname' and made
inconsistent `if_list' where all attached interfaces linked.
2. While performing if_clone_create(), concurrent thread which performing
if_clone_destroy() can kill this incomplete `ifp'.
3. While performing if_clone_destroy(), concurrent thread which performing
if_clone_destroy() can kill this dying `ifp'.
ok claudio@ kn@ mpi@ sashan@
Diffstat (limited to 'sys/net/if_tun.h')
0 files changed, 0 insertions, 0 deletions