From owner-freebsd-stable@freebsd.org Thu Jul 25 14:39:37 2019 Return-Path: Delivered-To: freebsd-stable@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 8E6A9A6052 for ; Thu, 25 Jul 2019 14:39:37 +0000 (UTC) (envelope-from trond.endrestol@ximalas.info) Received: from enterprise.ximalas.info (enterprise.ximalas.info [IPv6:2001:700:1100:1::8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "ximalas.info", Issuer "Hostmaster ximalas.info" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C7AB8854B7; Thu, 25 Jul 2019 14:39:36 +0000 (UTC) (envelope-from trond.endrestol@ximalas.info) Received: from enterprise.ximalas.info (Ximalas@localhost [127.0.0.1]) by enterprise.ximalas.info (8.15.2/8.15.2) with ESMTPS id x6PEdSHI008966 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 25 Jul 2019 16:39:28 +0200 (CEST) (envelope-from trond.endrestol@ximalas.info) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ximalas.info; s=default; t=1564065569; bh=UAFimI3ifxvUydnu4RYmnrtIlJ2heOdTYiNFRBcNa7U=; h=Date:From:To:cc:Subject; b=T1lwW+IXjXitRUqlMMWIrkfsR+a1istflucBghwvp5tMh5XSeqOyRhfWNZRImli6o 50umKlv0XFF0fV+gZIzohfTllZPWEhX5itug1mw9RKcOThK1Q3kNL3NV5iIIbC5Th8 Sdr+ht16WVFQ7QlEEKOO/HAYP7FOjoeH6l9N143Z+ShGy0e3F2aQzGx6rhS7xFq91z 7JL/ktbQv+lznygjPHqgfod7IXlukP+s4mEFU6mPrTE8rJB7YgjxxPAZqV2TUJG2TA l+2H4LY831jngDHShQ9ZmCyIM7IOhc7P7vAxE8GXFGzKwHMkzjNNkFoAWwKBK1cMiE BpCOnBBNRdLow== Received: from localhost (trond@localhost) by enterprise.ximalas.info (8.15.2/8.15.2/Submit) with ESMTP id x6PEdSTb008963; Thu, 25 Jul 2019 16:39:28 +0200 (CEST) (envelope-from trond.endrestol@ximalas.info) X-Authentication-Warning: enterprise.ximalas.info: trond owned process doing -bs Date: Thu, 25 Jul 2019 16:39:28 +0200 (CEST) From: =?UTF-8?Q?Trond_Endrest=C3=B8l?= Sender: Trond.Endrestol@ximalas.info To: freebsd-stable@freebsd.org cc: kp@freebsd.org, kevans@freebsd.org Subject: net/ocserv (and ifconfig) unable to destroy tun interfaces post r345045 Message-ID: User-Agent: Alpine 2.21.99999 (BSF 352 2019-06-22) OpenPGP: url=http://ximalas.info/about/tronds-openpgp-public-key MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on enterprise.ximalas.info X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2019 14:39:37 -0000 Hi, I have a VPN service running net/ocserv 0.12.4_1. Everything is ok until the first client disconnects. The main ocserv process hangs while destroying the tun interface, waiting indefinitely on "tun_cond". I ran an ocserv executable containing debug symbols through gdb and I had a breakpoint on the call to ioctl(fd, SIOCIFDESTROY, &ifr), at tun.c:770 of net/ocserv. The call to ioctl() has apparently a valid file descriptor, fd, and the fields of ifr are all zero, save the ifr_name field which contains "vpns0" and is properly null terminated. On the first attempt, I let the code run its course and had to reboot to recover. On the second attempt, I killed the ocserv process from within gdb. I ran "ifconfig vpns0 destroy" myself, and ifconfig froze immediately. Rebooting is the only way to recover. Reverting to stable/12 r345045 makes ocserv serve the clients again. My guess is that one or more of r345285, r347378, and/or r348124, all related to sys/net/if_tun.c, are to blame. Can someone verify my claims? See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238500 https://gitlab.com/openconnect/ocserv/issues/213 -- Trond.