summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-06-27 03:29:25 +0000
committerrwatson <rwatson@FreeBSD.org>2004-06-27 03:29:25 +0000
commitb9d22ffbfa3cc28f41ac21c00f491aa09fa3722b (patch)
tree3b1dc05ffe08b9e767f2d4cb28871dcb3a646275 /sys
parent6d1f3e3cef2fb2d881c6502664372d02a84c5db3 (diff)
downloadFreeBSD-src-b9d22ffbfa3cc28f41ac21c00f491aa09fa3722b.zip
FreeBSD-src-b9d22ffbfa3cc28f41ac21c00f491aa09fa3722b.tar.gz
Acquire the socket buffer lock when calling unp_scan() on
so->so_rcv.sb_mb to prevent the mbuf chain from changing during the scan.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_usrreq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 95e4874..2a992bf 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1492,7 +1492,9 @@ unp_gc()
* message buffers. Follow those links and mark them
* as accessible too.
*/
+ SOCKBUF_LOCK(&so->so_rcv);
unp_scan(so->so_rcv.sb_mb, unp_mark);
+ SOCKBUF_UNLOCK(&so->so_rcv);
}
} while (unp_defer);
sx_sunlock(&filelist_lock);
OpenPOWER on IntegriCloud