path: root/sys/sys/unpcb.h
diff options
authorJohn Baldwin <jhb@FreeBSD.org>2007-01-05 19:59:46 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2007-01-05 19:59:46 +0000
commit9ae328fc8f1a6ede2e46280a6192f6e9e77d38db (patch)
treee46a50c7a9eee093c285b17e8f575f16faf97862 /sys/sys/unpcb.h
parent663b416f164c1d7dba380dfe22e45584dae78fa2 (diff)
- Close a race between enumerating UNIX domain socket pcb structures via
sysctl and socket teardown by adding a reference count to the UNIX domain pcb object and fixing the sysctl that enumerates unpcbs to grab a reference on each unpcb while it builds the list to copy out to userland. - Close a race between UNIX domain pcb garbage collection (unp_gc()) and file descriptor teardown (fdrop()) by adding a new garbage collection flag FWAIT. unp_gc() sets FWAIT while it walks the message buffers in a UNIX domain socket looking for nested file descriptor references and clears the flag when it is finished. fdrop() checks to see if the flag is set on a file descriptor whose refcount just dropped to 0 and waits for unp_gc() to clear the flag before completely destroying the file descriptor. MFC after: 1 week Reviewed by: rwatson Submitted by: ups Hopefully makes the panics go away: mx1
Notes: svn path=/head/; revision=165810
Diffstat (limited to 'sys/sys/unpcb.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/unpcb.h b/sys/sys/unpcb.h
index b910f035acd9..129583dbe804 100644
--- a/sys/sys/unpcb.h
+++ b/sys/sys/unpcb.h
@@ -78,6 +78,7 @@ struct unpcb {
unp_gen_t unp_gencnt; /* generation count of this instance */
int unp_flags; /* flags */
struct xucred unp_peercred; /* peer credentials, if applicable */
+ u_int unp_refcount;