From nobody Mon Apr 11 22:03:49 2022 X-Original-To: dev-commits-src-main@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 0926D11DC8CF; Mon, 11 Apr 2022 22:03:59 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (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 (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KcjYV0sdkz4Tkv; Mon, 11 Apr 2022 22:03:58 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 23BM3nhT018688 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 11 Apr 2022 15:03:50 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 23BM3nDO018687; Mon, 11 Apr 2022 15:03:49 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Mon, 11 Apr 2022 15:03:49 -0700 From: Gleb Smirnoff To: Mike Karels Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 6ca0ca7b4cb5 - main - IPv4 multicast: fix LOR in shutdown path Message-ID: References: <202204111952.23BJqD1A028664@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202204111952.23BJqD1A028664@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4KcjYV0sdkz4Tkv X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=softfail (mx1.freebsd.org: 162.251.186.162 is neither permitted nor denied by domain of glebius@freebsd.org) smtp.mailfrom=glebius@freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.84)[-0.845]; FREEFALL_USER(0.00)[glebius]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; DMARC_NA(0.00)[freebsd.org]; R_SPF_SOFTFAIL(0.00)[~all:c]; MID_RHS_MATCH_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.96)[-0.960]; MLMMJ_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Hi Mike, On Mon, Apr 11, 2022 at 07:52:13PM +0000, Mike Karels wrote: M> The branch main has been updated by karels: M> M> URL: https://cgit.FreeBSD.org/src/commit/?id=6ca0ca7b4cb527dc17c289f1ae177ec267fd1add M> M> commit 6ca0ca7b4cb527dc17c289f1ae177ec267fd1add M> Author: Mike Karels M> AuthorDate: 2022-04-08 12:37:15 +0000 M> Commit: Mike Karels M> CommitDate: 2022-04-11 19:51:16 +0000 M> M> IPv4 multicast: fix LOR in shutdown path M> M> X_ip_mrouter_done() was calling the interface ioctl routines via M> if_allmulti() while holding a write lock. However, some interface M> ioctl routines, including em/iflib and tap, use sxlocks, which are M> not permitted while holding a non-sleepable lock, and this elicits M> a warning from WITNESS. Fix the locking issue by recording the M> affected interface pointers in a malloc'ed array, and call M> if_allmulti() on each after dropping the rwlock. I'm sorry for not reviewing that in time. I think this change is a good fix but would great to bring more generality here. We already have mechanism to handle exactly this problem, but with SIOCADDMULTI, see if_addmulti(). This mechanism can't be used to handle SIOCSIFFLAGS as is. We need to store the command and its argument somewhere, probably in the struct ifnet itself. This has two complications: - We won't be able to to queue multiple events on this task. I think this is fine. - This will require some locking. But if_amcount (and other similar fields) aren't properly locked now, so locking of interface flags and their counts is required anyway. -- Gleb Smirnoff