tcp: Fix getcred
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 3 Sep 2014 12:56:59 +0000 (20:56 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 3 Sep 2014 12:56:59 +0000 (20:56 +0800)
commit16d3b971c298bb8dbcfc5ed147f5567134f59854
tree47ab2873daa3904ec16b7acdbd6ea20801003826
parenta74edad3add165915c0d63d3d826d3489c77035d
tcp: Fix getcred

- Migrate to the target cpu before looking up tcp inpcb.
- Save a copy of the ucred then do SYSCTL_OUT, which could block.
  It is not MPSAFE to do the SYSCTL_OUT even on the target CPU;
  the socket might be ripped when SYSCTL_OUT blocked.
sys/netinet/tcp_subr.c