summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2002-05-06 19:31:28 +0000
committeralfred <alfred@FreeBSD.org>2002-05-06 19:31:28 +0000
commitd1e340364b9883eebdfb4928891b438172fe13fb (patch)
tree2b65f57e5ea93f67973ae506e853d0b56f0f9adc /sys/net
parent06d090201082aed150ddddb16d8da5721b05c296 (diff)
downloadFreeBSD-src-d1e340364b9883eebdfb4928891b438172fe13fb.zip
FreeBSD-src-d1e340364b9883eebdfb4928891b438172fe13fb.tar.gz
Make funsetown() take a 'struct sigio **' so that the locking can
be done internally. Ensure that no one can fsetown() to a dying process/pgrp. We need to check the process for P_WEXIT to see if it's exiting. Process groups are already safe because there is no such thing as a pgrp zombie, therefore the proctree lock completely protects the pgrp from having sigio structures associated with it after it runs funsetownlst. Add sigio lock to witness list under proctree and allproc, but over proc and pgrp. Seigo Tanimura helped with this.
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/bpf.c2
-rw-r--r--sys/net/if_tap.c2
-rw-r--r--sys/net/if_tun.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 325af54..1476498 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -368,7 +368,7 @@ bpfclose(dev, flags, fmt, td)
callout_stop(&d->bd_callout);
d->bd_state = BPF_IDLE;
BPFD_UNLOCK(d);
- funsetown(d->bd_sigio);
+ funsetown(&d->bd_sigio);
mtx_lock(&bpf_mtx);
if (d->bd_bif)
bpf_detachd(d);
diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c
index 45ce21f..ef0a36d 100644
--- a/sys/net/if_tap.c
+++ b/sys/net/if_tap.c
@@ -491,7 +491,7 @@ tapclose(dev, foo, bar, td)
splx(s);
}
- funsetown(tp->tap_sigio);
+ funsetown(&tp->tap_sigio);
selwakeup(&tp->tap_rsel);
tp->tap_flags &= ~TAP_OPEN;
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index a6c89fb..18435fd 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -335,7 +335,7 @@ tunclose(dev_t dev, int foo, int bar, struct thread *td)
splx(s);
}
- funsetown(tp->tun_sigio);
+ funsetown(&tp->tun_sigio);
selwakeup(&tp->tun_rsel);
TUNDEBUG ("%s%d: closed\n", ifp->if_name, ifp->if_unit);
OpenPOWER on IntegriCloud