Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jun 2002 08:57:10 -0700
From:      Jeffrey Hsu <hsu@FreeBSD.org>
To:        Maxime Henrion <mux@freebsd.org>
Cc:        current@FreeBSD.org
Subject:   Re: fix for a bug that causes a panic in the udp_pcblist() sysctl
Message-ID:  <0GY2005KRCAZM9@mta5.snfc21.pbi.net>
In-Reply-To: Message from Maxime Henrion <mux@freebsd.org> "of Fri, 21 Jun 2002 06:42:39 PDT." <20020621134239.GX85244@elvis.mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Can you try this fix instead?  It's based on a similar patch Jonathan Lemon
sent to me for a similar spot in tcp_subr.c.

Index: udp_usrreq.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/udp_usrreq.c,v
retrieving revision 1.113
diff -u -r1.113 udp_usrreq.c
--- udp_usrreq.c	14 Jun 2002 08:35:14 -0000	1.113
+++ udp_usrreq.c	21 Jun 2002 15:54:26 -0000
@@ -615,12 +615,9 @@
 	for (inp = LIST_FIRST(udbinfo.listhead), i = 0; inp && i < n;
 	     inp = LIST_NEXT(inp, inp_list)) {
 		INP_LOCK(inp);
-		if (inp->inp_gencnt <= gencnt) {
-			if (cr_canseesocket(req->td->td_ucred,
-			    inp->inp_socket))
-				continue;
+		if (inp->inp_gencnt <= gencnt &&
+		    cr_canseesocket(req->td->td_ucred, inp->inp_socket) == 0)
 			inp_list[i++] = inp;
-		}
 		INP_UNLOCK(inp);
 	}
 	INP_INFO_RUNLOCK(&udbinfo);



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0GY2005KRCAZM9>