Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Aug 2018 18:35:49 +0200
From:      "Kristof Provost" <kp@FreeBSD.org>
To:        "Cy Schubert" <Cy.Schubert@cschubert.com>
Cc:        "Devin Teske" <dteske@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r337611 - head/cddl/usr.sbin/dwatch/libexec
Message-ID:  <2A5DDBE0-5A97-4B78-8A1E-5B1E11AE1B76@FreeBSD.org>
In-Reply-To: <201808111630.w7BGUigO095292@slippy.cwsent.com>
References:  <201808111630.w7BGUigO095292@slippy.cwsent.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11 Aug 2018, at 18:30, Cy Schubert wrote:
> In message <ADEDC9DF-7A3E-40C3-A931-C87865363F39@FreeBSD.org>, 
> "Kristof
> Provost
> " writes:
>>
>> --=_MailMate_CF172F01-6AF0-4E9D-A175-454A09953300_=
>> Content-Type: text/plain; format=flowed
>>
>> Hi Devin,
>>
>> On 11 Aug 2018, at 8:32, Devin Teske wrote:
>>> Author: dteske
>>> Date: Sat Aug 11 06:32:31 2018
>>> New Revision: 337611
>>> URL: https://svnweb.freebsd.org/changeset/base/337611
>>>
>>> Log:
>>>   dwatch(1): Add systop profile
>>>
>>>   Provides a top-like view of syscall consumers.
>>>
>>>   MFC after:	3 days
>>>   X-MFC-to:	stable/11
>>>   Sponsored by:	Smule, Inc.
>>>
>>> Added:
>>>   head/cddl/usr.sbin/dwatch/libexec/systop   (contents, props 
>>> changed)
>>> Modified:
>>>   head/cddl/usr.sbin/dwatch/libexec/Makefile
>>>
>>> Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile
>>> ===========================================================================
>> ===
>>> --- head/cddl/usr.sbin/dwatch/libexec/Makefile	Sat Aug 11 06:13:11
>>> 2018	(r337610)
>>> +++ head/cddl/usr.sbin/dwatch/libexec/Makefile	Sat Aug 11 06:32:31
>>> 2018	(r337611)
>>> @@ -62,6 +62,7 @@ LINKS+=	${LIBEXECDIR}/dwatch/sendrecv
>>> ${LIBEXECDIR}/dw
>>>  LINKS+=	${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send
>>>  LINKS+=	${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg
>>>  LINKS+=	${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto
>>> +LINKS+=	${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop
>>
>> This breaks install world:
>> install: link
>> /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/dwatch/systop
>> ->
>> /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/dwatch/systop:
>> No such file or directory
>>
>> Regards,
>> Kristof
>
> Hi Kristof,
>
> This should get you going.
>
> Index: /opt/src/svn-current/cddl/usr.sbin/dwatch/libexec/Makefile
> ===================================================================
> --- /opt/src/svn-current/cddl/usr.sbin/dwatch/libexec/Makefile	
> (revision 337628)
> +++ 
> /opt/src/svn-current/cddl/usr.sbin/dwatch/libexec/Makefile	(working
> copy)
> @@ -12,6 +12,7 @@
>  		rw \
>  		sched \
>  		sendrecv \
> +		systop \
>  		tcp \
>  		udp \
>  		udplite \
> @@ -62,7 +63,6 @@
>  LINKS+=	${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send
>  LINKS+=	${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg
>  LINKS+=	${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto
> -LINKS+=	${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop
>  LINKS+=	${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept
>  LINKS+=	${LIBEXECDIR}/dwatch/tcp 
> ${LIBEXECDIR}/dwatch/tcp-accept-establ
> ished
>  LINKS+=	${LIBEXECDIR}/dwatch/tcp 
> ${LIBEXECDIR}/dwatch/tcp-accept-refuse
> d
>
Thanks for the pointer.
Brad’s fixed it meanwhile.

Regards,
Kristof
From owner-svn-src-head@freebsd.org  Sat Aug 11 16:37:56 2018
Return-Path: <owner-svn-src-head@freebsd.org>
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7F921073355;
 Sat, 11 Aug 2018 16:37:56 +0000 (UTC) (envelope-from kp@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 75EC58822F;
 Sat, 11 Aug 2018 16:37:56 +0000 (UTC) (envelope-from kp@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 574B619C5D;
 Sat, 11 Aug 2018 16:37:56 +0000 (UTC) (envelope-from kp@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BGbuX7025485;
 Sat, 11 Aug 2018 16:37:56 GMT (envelope-from kp@FreeBSD.org)
Received: (from kp@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BGbucG025484;
 Sat, 11 Aug 2018 16:37:56 GMT (envelope-from kp@FreeBSD.org)
Message-Id: <201808111637.w7BGbucG025484@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org
 using -f
From: Kristof Provost <kp@FreeBSD.org>
Date: Sat, 11 Aug 2018 16:37:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r337644 - head/sys/netpfil/pf
X-SVN-Group: head
X-SVN-Commit-Author: kp
X-SVN-Commit-Paths: head/sys/netpfil/pf
X-SVN-Commit-Revision: 337644
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.27
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 <svn-src-head.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-head>,
 <mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head/>;
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-head>,
 <mailto:svn-src-head-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 11 Aug 2018 16:37:57 -0000

Author: kp
Date: Sat Aug 11 16:37:55 2018
New Revision: 337644
URL: https://svnweb.freebsd.org/changeset/base/337644

Log:
  pf: Take the IF_ADDR_RLOCK() when iterating over the group list
  
  We did do this elsewhere in pf, but the lock was missing here.
  
  Sponsored by:	Essen Hackathon

Modified:
  head/sys/netpfil/pf/pf_if.c

Modified: head/sys/netpfil/pf/pf_if.c
==============================================================================
--- head/sys/netpfil/pf/pf_if.c	Sat Aug 11 16:34:30 2018	(r337643)
+++ head/sys/netpfil/pf/pf_if.c	Sat Aug 11 16:37:55 2018	(r337644)
@@ -297,11 +297,16 @@ pfi_kif_match(struct pfi_kif *rule_kif, struct pfi_kif
 	if (rule_kif == NULL || rule_kif == packet_kif)
 		return (1);
 
-	if (rule_kif->pfik_group != NULL)
-		/* XXXGL: locking? */
+	if (rule_kif->pfik_group != NULL) {
+		IF_ADDR_RLOCK(packet_kif->pfik_ifp);
 		CK_STAILQ_FOREACH(p, &packet_kif->pfik_ifp->if_groups, ifgl_next)
-			if (p->ifgl_group == rule_kif->pfik_group)
+			if (p->ifgl_group == rule_kif->pfik_group) {
+				IF_ADDR_RUNLOCK(packet_kif->pfik_ifp);
 				return (1);
+			}
+		IF_ADDR_RUNLOCK(packet_kif->pfik_ifp);
+	}
+
 
 	return (0);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2A5DDBE0-5A97-4B78-8A1E-5B1E11AE1B76>