diff options
author | tanimura <tanimura@FreeBSD.org> | 2002-04-27 08:24:29 +0000 |
---|---|---|
committer | tanimura <tanimura@FreeBSD.org> | 2002-04-27 08:24:29 +0000 |
commit | dbb4756491715a06ce4578841f6eba43fc62fa70 (patch) | |
tree | 982f8e96f9de9e219deaa4ea138a8334dc086c3c /sys/netkey/keysock.c | |
parent | bcaaa89ad095d7a175927dd7e531fa6f278ed18e (diff) | |
download | FreeBSD-src-dbb4756491715a06ce4578841f6eba43fc62fa70.zip FreeBSD-src-dbb4756491715a06ce4578841f6eba43fc62fa70.tar.gz |
Add a global sx sigio_lock to protect the pointer to the sigio object
of a socket. This avoids lock order reversal caused by locking a
process in pgsigio().
sowakeup() and the callers of it (sowwakeup, soisconnected, etc.) now
require sigio_lock to be locked. Provide sowwakeup_locked(),
soisconnected_locked(), and so on in case where we have to modify a
socket and wake up a process atomically.
Diffstat (limited to 'sys/netkey/keysock.c')
-rw-r--r-- | sys/netkey/keysock.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/netkey/keysock.c b/sys/netkey/keysock.c index 6d00e48..5b733cd73 100644 --- a/sys/netkey/keysock.c +++ b/sys/netkey/keysock.c @@ -428,8 +428,10 @@ key_attach(struct socket *so, int proto, struct thread *td) key_cb.any_count++; kp->kp_raw.rcb_laddr = &key_src; kp->kp_raw.rcb_faddr = &key_dst; - soisconnected(so); + SIGIO_SLOCK(); + soisconnected_locked(so); so->so_options |= SO_USELOOPBACK; + SIGIO_SUNLOCK(); splx(s); return 0; |