kernel - Fix deep stack recursion in unix domain socket garbage collection
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 1 Dec 2010 17:53:08 +0000 (09:53 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 1 Dec 2010 17:53:08 +0000 (09:53 -0800)
commit82b1d9f2986a04924803359759c12bab32b9cf1c
treea68fccaa79d47a43b34c40a7b9f78d4747a0233a
parentbff42f936fe14e5f5ff19f72091d2f1d9321c2d4
kernel - Fix deep stack recursion in unix domain socket garbage collection

* A chain of unix domain sockets with the previous fd passed into the
  next one can cause a kernel stack overflow.

* Flatten the portion of the gc which would otherwise recurse by placing
  the fp on a list instead of calling a nested closef(), then running
  the closes at the top level.

Reported-by: Venkatesh Srinivas <me@endeavour.zapto.org>
sys/kern/uipc_usrreq.c