svn commit: r351507 - stable/12/sys/kern
Andrey V. Elsukov
ae at FreeBSD.org
Mon Aug 26 09:29:15 UTC 2019
Author: ae
Date: Mon Aug 26 09:29:14 2019
New Revision: 351507
URL: https://svnweb.freebsd.org/changeset/base/351507
Log:
MFC r351214:
Use TAILQ_FOREACH_SAFE() macro to avoid use after free in soclose().
PR: 239893
Modified:
stable/12/sys/kern/uipc_socket.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/kern/uipc_socket.c
==============================================================================
--- stable/12/sys/kern/uipc_socket.c Mon Aug 26 08:08:15 2019 (r351506)
+++ stable/12/sys/kern/uipc_socket.c Mon Aug 26 09:29:14 2019 (r351507)
@@ -1131,9 +1131,9 @@ drop:
so->so_state |= SS_NOFDREF;
sorele(so);
if (listening) {
- struct socket *sp;
+ struct socket *sp, *tsp;
- TAILQ_FOREACH(sp, &lqueue, so_list) {
+ TAILQ_FOREACH_SAFE(sp, &lqueue, so_list, tsp) {
SOCK_LOCK(sp);
if (sp->so_count == 0) {
SOCK_UNLOCK(sp);
More information about the svn-src-stable
mailing list