Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1804702pxb; Wed, 2 Feb 2022 12:55:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwN6DfDEW7IsA5aeLktqL+IjHzr8iPCNJD0yPChf4/+geVgX7vdrp3qsy3CoWzz1RlcPzUi X-Received: by 2002:a17:907:3d90:: with SMTP id he16mr25977669ejc.643.1643835345955; Wed, 02 Feb 2022 12:55:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643835345; cv=none; d=google.com; s=arc-20160816; b=WE82qe7+fDQDHNFxoJE3CIb/N/NvL6Mxe8HXhHHIABoed0ZIA46ASWjqzG/T34dlFc zha5C42dwqaraSMWqzmCEeLoYZqrBeNLZl3S+plmPU/b9LYzfx/uKDwlheFUByMUAjTt DCuWBYgS0UJt5fam12f4b+fcxYpPLK5bOKukEVRXH6odMyTw0FtJXJ0usxVmw3QOD4A+ YwJgWhoqIXBNyFIm4ADokqP7rbZYaK9fcGZ11TgMtoScWlvt1YGtrlJF624N1NHt8eUk T6r25QLkHHEBf6U6QVWiYnviM0mld05/uTi97I9z2MXyRmlgrx38Y21rYx5tHnJer18X kFiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=U9MwiE69FFYiqNdbpK+2KHWimAAANy1uoTSJ79l7QNg=; b=sJbdKPq5/u0F8REUfOA9N5yvHauk3Rxnu04wkqb10+GuDlnOKLFVUKBF0CGIc3jxf3 G4K2V1C3tgUdImmcmdE62vVCR1O0+A7jQdP+ekNY3DlxUBVSeCAD4KGDFrStDpBs6t5R K+k5JCaLDCgrMov7aB/svLUtQjhZgzpRDrXQky68OsYgq1YYZzdgDw8+tUqLnhOCdR5P c3ZXLDF7E4WzXwzO36bobkfyTaXJYO3Pk606GrQr5lwXERZbJmR53ROyanwT8zDco1nG dLFfUhBfML7gYvSNFhPP93wXWGyUCRyaSNo+AevuG/Jjvgge6bUeRocWTjJGPduHeFEW MKVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wx1QKXvA; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e26si12941402edr.119.2022.02.02.12.55.24; Wed, 02 Feb 2022 12:55:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wx1QKXvA; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239366AbiBAOfp (ORCPT + 65 others); Tue, 1 Feb 2022 09:35:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239320AbiBAOfo (ORCPT ); Tue, 1 Feb 2022 09:35:44 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3200BC061714 for ; Tue, 1 Feb 2022 06:35:44 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E7021B82E0E for ; Tue, 1 Feb 2022 14:35:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C83F9C340EB; Tue, 1 Feb 2022 14:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643726141; bh=N5N9SR6OoG9mmDAdilZCbFmm+lbMg6h87u4WGMB2Gmg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Wx1QKXvAsKP2knBT33/6662FbxiGS2MfP2QBGqxc5D3f/iAdjTmNzOI8LoRGXTJl0 rup56ugo3eCSyJ17KlRW/I3tVMNdeQeQaFPOTdljKaw75gDLhdRsF1LbiZ7uXM4jdi fiWExz3WVOJiZr4S+rKZKm+3Y16jbDbzAabKfd12P5r46QEZ72Fs1PN+hIMfwQLfRi +GyXRVcQlN55o4rUa1SPOuFPkvd/MUksoKZQDJNRkO4o5bqmIauGhIWVTsuq32hlIS LkbbafrNa8+v4XGeRrSU5HV55Afc/AsCrkiRJrAOq3gqF1JCjch51535vL0OpjPCqO jDBzx9teLEULQ== From: Kalle Valo To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Johannes Berg , Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= Subject: Re: [PATCH] cfg80211: fix race in netlink owner interface destruction References: <20220201130951.22093-1-johannes@sipsolutions.net> Date: Tue, 01 Feb 2022 16:35:36 +0200 In-Reply-To: <20220201130951.22093-1-johannes@sipsolutions.net> (Johannes Berg's message of "Tue, 1 Feb 2022 14:09:51 +0100") Message-ID: <871r0md58n.fsf@tynnyri.adurom.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Johannes Berg writes: > From: Johannes Berg > > My previous fix here to fix the deadlock left a race where > the exact same deadlock (see the original commit referenced > below) can still happen if cfg80211_destroy_ifaces() already > runs while nl80211_netlink_notify() is still marking some > interfaces as nl_owner_dead. > > The race happens because we have two loops here - first we > dev_close() all the netdevs, and then we destroy them. If we > also have two netdevs (first one need only be a wdev though) > then we can find one during the first iteration, close it, > and go to the second iteration -- but then find two, and try > to destroy also the one we didn't close yet. > > Fix this by only iterating once. > > Change-Id: Ie56cd0ef3f0d2108bb8a25c8bb5efced15e6a909 You forgot the Change-Id. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches