From owner-freebsd-net@freebsd.org Fri Jul 10 20:29:18 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C5E33728E4 for ; Fri, 10 Jul 2020 20:29:18 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4B3Plf1rWGz3d16 for ; Fri, 10 Jul 2020 20:29:18 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by mailman.nyi.freebsd.org (Postfix) id 3D988372D89; Fri, 10 Jul 2020 20:29:18 +0000 (UTC) Delivered-To: net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D638372CA3 for ; Fri, 10 Jul 2020 20:29:18 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B3Plf0nPbz3cxf; Fri, 10 Jul 2020 20:29:18 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id D9C0410757; Fri, 10 Jul 2020 20:29:17 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 63EF01265A; Fri, 10 Jul 2020 22:29:16 +0200 (CEST) From: "Kristof Provost" To: "Kajetan Staszkiewicz" Cc: net@FreeBSD.org Subject: Re: Deadlocks when using pf tags or socket owner matching Date: Fri, 10 Jul 2020 22:29:15 +0200 X-Mailer: MailMate (1.13.1r5671) Message-ID: <7572280D-1808-46FE-AD72-06F827E1512A@FreeBSD.org> In-Reply-To: References: <48de3ee4-ba52-f6a7-b2d7-c7d77a635eb9@tuxpowered.net> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 20:29:18 -0000 On 8 Jul 2020, at 12:52, Kajetan Staszkiewicz wrote: > I have forgot to mention my system: it's FreeBSD 11.3-RELEASE-p9 > > I have also managed to replicate this (or a similar) issue on a test > system built with lock debugging and I got this: > > Jul 8 10:32:07 hwlb-aw-01 kernel: lock order reversal: > Jul 8 10:32:07 hwlb-aw-01 kernel: 1st 0xffffffff81850760 pf rulesets > (pf rulesets) @ > /usr/home/kajetan.staszkiewicz/freebsd.git/sys/netpfil/pf/pf.c:6006 > Jul 8 10:32:07 hwlb-aw-01 kernel: 2nd 0xfffff8011f7028a8 tcpinp > (tcpinp) @ > /usr/home/kajetan.staszkiewicz/freebsd.git/sys/netinet/in_pcb.c:1994 This lock order reversal is almost certainly the reason for the deadlock you report in your previous e-mail. The problem relates to the UID filtering functionality, so not using that feature will avoid the deadlock. I believe I’ve seen previous reports about issues in this area as well. I’ll try to put this on my short-sh term todo list, but I can’t promise anything. Free time is exceptionally rare these days. Best regards, Kristof