From nobody Fri Sep 06 17:15:46 2024 X-Original-To: freebsd-hackers@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 4X0jYJ3jQLz5VXny for ; Fri, 06 Sep 2024 17:15:48 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0jYJ2WvZz46lk; Fri, 6 Sep 2024 17:15:47 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Authentication-Results: mx1.freebsd.org; none Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.18.1/8.18.1) with ESMTP id 486HFkHR015532; Fri, 6 Sep 2024 10:15:46 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) DKIM-Filter: OpenDKIM Filter v2.10.3 troutmask.apl.washington.edu 486HFkHR015532 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=troutmask.apl.washington.edu; s=troutmask; t=1725642946; bh=51m7e+YwK30hv2Lrx5UOab3eqWaSFjH4vSlrfOoODpM=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=QafYIXG0US0ZT5oxDMoVpXL/78+kHyoAWq+W3izHup1NV+RGXImznmVGabQ9nITXh VHId3hwm7wZiSKor/2zNHtX+KThWuLU8hkumGAXr4cv8paEij8Pon9Ens5dCiYeZM9 gGdRT2sOgHkNF39NwjT77y2zEo5nQObNiAclndkc+EzhM+w+tkn2TgLzBOwN3XEVVh oFnT+95sdoyA7k+vMNtLT0tGWelW0odadTjsSuwmSS7i5D44L+oPo1C+LxAcTEkFpA 01gklgZScyJNEtAkdBBtuSOiF5WGNFQBMubfCS6uXj1hF0UjGZpxX6yX9UeNVRhv2n BICtVYkxl9v4w== Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.18.1/8.18.1/Submit) id 486HFkBE015531; Fri, 6 Sep 2024 10:15:46 -0700 (PDT) (envelope-from sgk) Date: Fri, 6 Sep 2024 10:15:46 -0700 From: Steve Kargl To: Kristof Provost Cc: freebsd-hackers@freebsd.org Subject: Re: New lock-order reversal Message-ID: Reply-To: sgk@troutmask.apl.washington.edu References: <72AF10E0-CB5A-4CB6-A50A-30A06DB7EA03@FreeBSD.org> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <72AF10E0-CB5A-4CB6-A50A-30A06DB7EA03@FreeBSD.org> X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:73, ipnet:128.95.0.0/16, country:US] X-Rspamd-Queue-Id: 4X0jYJ2WvZz46lk On Fri, Sep 06, 2024 at 06:49:48PM +0200, Kristof Provost wrote: > Hi Steve, > > On 6 Sep 2024, at 17:54, Steve Kargl wrote: > > FYI (and return hackers to a non-language) > > > > Update my old system to circa Aug 10, 2024 top-of-tree > > and rebuilts all installed ports. I'm now see a new > > lock-order reversal while using openvpn. > > (trace elided) > I don’t think that’s new. It’s an order issue between if_ovpn establishing > the UDP tunnel callback (which requires the UDP lock) and the normal traffic > flow, where the UDP lock is taken, the tunnel function is called and that > then takes the if_ovpn lock. Yeah, I should have looked at bugzilla. There is a report of the LoR. > I’ve had another look at this, and while I can probably avoid this for > setting the tunnel function (basically by assuming setting it never fails or > is already done, which is currently the case), I’m not happy with the only > solution I see on the removal side (i.e. “don’t, just trust that the socket > will be closed soon”). Thanks for the patch. I'll add to my kernel when I rebuild it. Unfortuantely, I have way too little understanding about locking within the kernel to be of much help. -- steve