From owner-freebsd-net@freebsd.org Tue Apr 18 09:33:13 2017 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D671D4203B for ; Tue, 18 Apr 2017 09:33:13 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward5p.cmail.yandex.net (forward5p.cmail.yandex.net [IPv6:2a02:6b8:0:1465::15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01706EFF for ; Tue, 18 Apr 2017 09:33:12 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp1h.mail.yandex.net (smtp1h.mail.yandex.net [84.201.187.144]) by forward5p.cmail.yandex.net (Yandex) with ESMTP id DEADD20EFE; Tue, 18 Apr 2017 12:33:00 +0300 (MSK) Received: from smtp1h.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1h.mail.yandex.net (Yandex) with ESMTP id B21958C063E; Tue, 18 Apr 2017 12:32:58 +0300 (MSK) Received: by smtp1h.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id NtSNbWcRKs-WwT8Jri5; Tue, 18 Apr 2017 12:32:58 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1492507978; bh=yOENhEBunu8vsadV9SZ43CjybNCiRq8C7ZmMMwo6GKI=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To; b=fiSsLxyd6i4h6l+3eLN5RAPRk5ftFAbiPLmir5lXXFOFuvcHiZAApNb3iJ+JABYQT rx9MssDLmwfyznBIER+3CxPbQCR9OY53A4rSQSF+Hb9pa2xmvL/gmiD0maM6MkSPc8 rCY9aHGvDIo/Jz0veC4F59m4G7UWARHlkaBZO8B4= Authentication-Results: smtp1h.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0 Subject: Re: Deadlock in ifaddr_change() while removing IPFW rules To: "Julian K." , freebsd-net@freebsd.org References: <1ae1a996-7218-77b3-3617-b9ed4e45621b@kornberger.name> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Message-ID: Date: Tue, 18 Apr 2017 12:32:14 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <1ae1a996-7218-77b3-3617-b9ed4e45621b@kornberger.name> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="QpAKSMIitA7Gbp3cfUbTtkIQan0i0Xj6D" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Apr 2017 09:33:13 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --QpAKSMIitA7Gbp3cfUbTtkIQan0i0Xj6D Content-Type: multipart/mixed; boundary="l59gSRQ8ac2vO7XPwV19wWUix64tkIAgC"; protected-headers="v1" From: "Andrey V. Elsukov" To: "Julian K." , freebsd-net@freebsd.org Message-ID: Subject: Re: Deadlock in ifaddr_change() while removing IPFW rules References: <1ae1a996-7218-77b3-3617-b9ed4e45621b@kornberger.name> In-Reply-To: <1ae1a996-7218-77b3-3617-b9ed4e45621b@kornberger.name> --l59gSRQ8ac2vO7XPwV19wWUix64tkIAgC Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 18.04.2017 01:49, Julian K. wrote: > I wrote a kernel module [1] for a the fastd UDP tunneling protocol. Lik= e > the if_tun it calls if_purgeaddrs() on destruction of interfaces. When = I > delete IPFW rules a the same time the kernel runs into a deadlock. It > seems to be a general problem that also affects other network drivers. >=20 > Could someone please take a closer look at this issue? Below I attached= > some debugging outputs. > ipfw_chk() at ipfw_chk+0xa42/frame 0xfffffe0098192ee0 > ipfw_check_packet() at ipfw_check_packet+0xeb/frame 0xfffffe0098193040 > pfil_run_hooks() at pfil_run_hooks+0x83/frame 0xfffffe00981930d0 > ip_output() at ip_output+0xdd7/frame 0xfffffe0098193220 > icmp_reflect() at icmp_reflect+0x553/frame 0xfffffe00981932e0 > icmp_error() at icmp_error+0x525/frame 0xfffffe0098193330 > ipfw_chk() at ipfw_chk+0x30bb/frame 0xfffffe0098193520 > ipfw_check_packet() at ipfw_check_packet+0xeb/frame 0xfffffe0098193680 > pfil_run_hooks() at pfil_run_hooks+0x83/frame 0xfffffe0098193710 > ip_input() at ip_input+0x39d/frame 0xfffffe0098193770 > netisr_dispatch_src() at netisr_dispatch_src+0xa5/frame 0xfffffe0098193= 7d0 What FreeBSD version do you use? There were several changes in head/ and stable/11, that could change this behavior. Can you try the same on recent revision? --=20 WBR, Andrey V. Elsukov --l59gSRQ8ac2vO7XPwV19wWUix64tkIAgC-- --QpAKSMIitA7Gbp3cfUbTtkIQan0i0Xj6D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlj13R4ACgkQAcXqBBDI oXoqZggAt6yX9/9SRUoAZ8glvGdsXIV7ePsf3ClnsaJmWs/B+q5vX3rqjsyEzABv aoqtmE6RdhFjdWHYrZJAQoJ+lQ4UIH+kPtHA/r2uFia/TvaEIDt85W2cA+ZNRulz CBePyAQF86+9q6LP45wm6V7qT07hvCF5QVVMCrgA0bNfrBc+Ni5cjuEQ5jb5Hkkl HKj5giVnaalMNTLG9eRRRYu8mNW2nrSnUKHkZFn776dJvo8EzbqpgmwppywZXVQF NzJc5kXiR3Bgywy5KP11+otWvituYJFjnOTfZ9JtjAASniQD15W7b6P7qwSxn5vK JudyNF3BLoWmGjPLl7QYOE59XIIxvQ== =GhgS -----END PGP SIGNATURE----- --QpAKSMIitA7Gbp3cfUbTtkIQan0i0Xj6D--