From nobody Sat Oct 4 16:24:14 2025 X-Original-To: freebsd-net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cf9qY3TnJz69GLQ for ; Sat, 04 Oct 2025 16:25:13 +0000 (UTC) (envelope-from bogorodskiy@gmail.com) Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cf9qX68rpz3HNT for ; Sat, 04 Oct 2025 16:25:12 +0000 (UTC) (envelope-from bogorodskiy@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-afcb7ae31caso612545066b.3 for ; Sat, 04 Oct 2025 09:25:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1759595105; x=1760199905; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=nCTXVqnN/TwlmIzKSMh1ttHK3IIR+WHjt5mA8na2pXs=; b=A1z8jl64tCdHMlyQ69u2I6H39kPGP/Qj8U3vpFYyjv6iNBhW9w+ARf26C1B5AGnxto OOZcmjD9boiYpV9sNB9/ZIot7Q3ura6SqgUqzTI+MAC+91K9k13ZADvCJLx7d0PVNkEk PH9t6GGr2mb5K3DzqviGQBWNpd0THy1jsQxD0nQjEuLj0aK4cdaqfYU7im48/6LvIT0V l7a8XImIVdbBYmoqTJUxxIbjT19jD3BmOfAAljfGANCFpOiTnzDaifKKrDOtLx+TVCUe IvJTw3M84ZyA3notSDbYwxn8dajtObWzB2hR1wtu3MHmm9yH6LjPjIf8Am8cXK94/9ys HAlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759595105; x=1760199905; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nCTXVqnN/TwlmIzKSMh1ttHK3IIR+WHjt5mA8na2pXs=; b=N1o4sVqRbJcuqelE9+gXu3iSeKk9hGgFs18Lav+dMiY6N5T+O3cb67eal/BqqQ3M7D vYukEyZaUd08icLYCeo5co0wZiD8oQ4D/ka5wnLifHOoRdsjpP9ug8ipGaNdqdHMpAIx bZ0rSxDTkeJsfQRTA6qey2wkKL8MWkFlbVydUVX7bQHKpizZvEEtVR5tArIyLwgR7MC5 VM5Tf64rUBX+9gBGfUfuHvJB96CSlge9d9rdk02HgcqN+tcC6ijJOqZ3mutIcd6/xGfQ qY8Bn+/h7uc94P/rGg1Gtuq4eMFe4zsbthtawjDI/3Sb2umQ7IN377mdFt9WW+dECzjJ zSkg== X-Gm-Message-State: AOJu0Yy8EpS4WUbR3RuLeDUwZOHinmhBaKRM7fuAd6x0H2lvpFXoKEV0 UtS1Q+aTBjqOoX2++CcDwLWbBge6PAFpyZSuBTOwCM2YN1ap9IoCSGD3 X-Gm-Gg: ASbGncuOnOG4HTGLRVmIoBy7eB/LcHqAF5kmQ970uw9SuWgVPTaAaUv4eTIZ5sAEIhy XR/HMaaCtgsyDopKYyc4DuBFspU4R3mYrLRk6VgGGptN7S9HeepcSpEWR9wALybspNkOblZ5q2n hAc/ptztd9qSdzqFnqhquIpsquIc9maI+Sn9bg8Gu5FcH2a79iGUdBeJaZLEAsEtO/tZjZTXNgx J38sws9JbozUSAzG1Ubjl9K9yYpi6PtyQTgta7uuoX23F+PNE57NHmr2GqIHbbxM4fZIOFkKHbt dRyML7fOtPNzeAVbHvHQRPYKStZP66ZT257z2EDs7vDdmE3JW3am5oNwWQHqX5KcXk6yO0GIzpg 1S+PP8pVwusfPED0kPmISr4GFq1uOVt1ydGTR7sBOc2cJFRAyg2Dn2XIrycaFIhzTGSsCM4RQjA +6xVUD9aN0jS6zHg== X-Google-Smtp-Source: AGHT+IErVctf2LWNBjp1qeYKLNq2ZuzNsWW1HrLdI/+7oE/PNR+Bpy6SDug5cy5NFyOYGZEtE7TOXQ== X-Received: by 2002:a17:907:724b:b0:b3a:875c:294f with SMTP id a640c23a62f3a-b49c157d098mr968023466b.10.1759595105021; Sat, 04 Oct 2025 09:25:05 -0700 (PDT) Received: from tulp (84-25-144-101.cable.dynamic.v4.ziggo.nl. [84.25.144.101]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b4865a7c660sm713457366b.22.2025.10.04.09.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Oct 2025 09:25:04 -0700 (PDT) Date: Sat, 4 Oct 2025 18:24:14 +0200 From: Roman Bogorodskiy To: Kyle Evans Cc: freebsd-net@freebsd.org Subject: Re: ifconfig(8) on trying to destroy tap(4) interface used by a process Message-ID: References: <87a30461-e2ee-4251-bad7-5bb900e85164@FreeBSD.org> List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a30461-e2ee-4251-bad7-5bb900e85164@FreeBSD.org> X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4cf9qX68rpz3HNT Kyle Evans wrote: > > ifconfig keeps hanging like that and exits only when the process that > > owns the tap(4) interface releases it. > > > > I don't seem to find anything about that in manual pages for both > > tap(4) and ifconfig(8) (probably missed something), but generally, I'd > > expect ifconfig to immediately exit with an error and non-zero exit > > code. > > > > I agree that it should be documented, but historically tun/tap have hung on > destroy if the cdev was still opened by a process. I made it interruptible[0] > somewhat recently, and also added a mode where tun/tap can be configured as > transient[1] so that they just naturally get destroyed on last close. Neither > of those have made it back to stable/14, but I don't think there's a reason > off-hand that they couldn't go back. Thanks for clarification. Both changes look nice to have in stable/14, especially [1], which should make device management/cleanup code a little simpler. > > Additionally, while trying to reproduce and document that, I've got a > > panic: > > > > FreeBSD tulp 16.0-CURRENT FreeBSD 16.0-CURRENT #6 main-n280778-f45608124286: Tue Sep 30 22:25:58 CEST 2025 root@tulp:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 > > > > panic: deadlres_td_sleep_q: possible deadlock detected for 0xfffff80022425780 (ifconfig), blocked for 1802579 ticks > > > > I was able to reproduce this ifconfig(8) behavior on 14.3-RELEASE-p1 > > too. > > > > Is it expected? > > > > I think so, yeah. > > > Thanks, > > Roman > > > > [0] https://cgit.freebsd.org/src/commit/sys/net/if_tuntap.c?id=274bf7c8ae7e7b51853cd541481985f0e687f10e > [1] https://cgit.freebsd.org/src/commit/sys/net/if_tuntap.c?id=a1174b3b1174754b1f69406bff4456d002e8f583 >