Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp920549rwi; Mon, 10 Oct 2022 08:51:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7SJCLNPnVMrS+yhrmH8XlA7TFtHWMN7DdVvwD/vfekHlyOmwyDxRGIwVYxZqY9tqL6Qss+ X-Received: by 2002:a05:6402:2804:b0:439:83c2:8be2 with SMTP id h4-20020a056402280400b0043983c28be2mr18936090ede.292.1665417113666; Mon, 10 Oct 2022 08:51:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665417113; cv=none; d=google.com; s=arc-20160816; b=BRSGtcfQvDBk/vT1nEQZuEEiv/Kf4Vky3x3ut0HndhVpF5FuvTpGS1PEkTBBJeaEsO SSfViS6viv/hF1wYfE+90JLnZoqY01sU1ODGqedjbamZeDnHjRPfe38bhGHtuhYeRThh iYRU8Mvq7JDSLHF2yKjZzjp67V/NWTd5IPEb3PxWaHE4We/JqCTxMGSqj1Xrw4KtcQQ6 V7/Jb3cJu1fUjHG8Wr8jPVo1eZwpNHHWtdFwlQqQTRbXYgx82SvQNlYCLH5lnSCH8up2 wP6p10Fl1xTmKkw0orK0uzkrojPHAkux/1iZ87vZf7/KEH1IHWEslmz+ovNVFHoEebkT xqYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=+LQpf2t187Wtu3L30cZgHTTrNCLNfAilq5iYZOPfuUM=; b=iLDhh7KU1rnp6lHHZ8rKKAEoqx2OWLZ4f0COtyPSKpvXF4P7h/9QfufVLOKllDAs+t t7cF0EKKtrjErUVtmBpaQGRn8/ALsF2Fm0O9NGaFgdtjyNATXXqRatQOrE4g0ZLHxiwC yfAJwyacI0UWIAppFSTxg2VMaFHylnCGqtoSTQHUFBLf9nCOldywShRq8ceiVCmMEt6e 6vy4Egwd3BPj6XL9f0IqsqVSAEDm9an/5OU6Zs8S1qNNbweUOcMqBaczNI6ci6zp3j8p rUuHD/3wKvtXUc9unf5baLp66XGW+qTebkLodVt7jXUCvKGUnzHWIVgiBzhkoSqrHKh1 qLXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d1bZqiV2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 m20-20020a056402511400b0045c2a92c120si2879054edd.520.2022.10.10.08.51.28; Mon, 10 Oct 2022 08:51:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=d1bZqiV2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S229813AbiJJPtz (ORCPT + 99 others); Mon, 10 Oct 2022 11:49:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229557AbiJJPtx (ORCPT ); Mon, 10 Oct 2022 11:49:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F486B4B1; Mon, 10 Oct 2022 08:49:49 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 9C74360F98; Mon, 10 Oct 2022 15:49:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 872CCC433C1; Mon, 10 Oct 2022 15:49:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665416988; bh=UGDgGegtJjnKbmhoE4P2UtEsFRje51IdIWm22s4C4TA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=d1bZqiV2Tu6H8mxgT+dt42VjS2eMUlx5s5xJ0xJYGUafxKiXXMqWyUMUOk1l1N3xp FeYm/W18GexXWjXxxt5tQGQux3dhNDVk2FRJ49YLaZCYd3pz/lqCSBC/dKrDbFX0rg 6JaDgTtky3z0XOUYhcSRffGaoQAGj6UQ1VfltBYYRqcrcYCyJGlVqMMlhPWyMrPJbA dMuuiv9G5MRDSAk17QFj3BTpK9JmGCk2aKggz9j/mtKGz2Z9ZoIM0giKY6KPVUoQD6 8FFwElf5bR1C8spnAarIw5ks3qR2dA+ud0gbGb/z7h8lybcFFE9LFMG8658ORsX6sH gaJvjRgTmk9ng== Date: Mon, 10 Oct 2022 08:49:46 -0700 From: Jakub Kicinski To: Sasha Levin Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Jiri Pirko , Vikas Gupta , davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, nicolas.dichtel@6wind.com, gnault@redhat.com, johannes@sipsolutions.net, netdev@vger.kernel.org Subject: Re: [PATCH AUTOSEL 6.0 17/77] genetlink: hold read cb_lock during iteration of genl_fam_idr in genl_bind() Message-ID: <20221010084946.5d32cd60@kernel.org> In-Reply-To: <20221009220754.1214186-17-sashal@kernel.org> References: <20221009220754.1214186-1-sashal@kernel.org> <20221009220754.1214186-17-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 9 Oct 2022 18:06:54 -0400 Sasha Levin wrote: > In genl_bind(), currently genl_lock and write cb_lock are taken > for iteration of genl_fam_idr and processing of static values > stored in struct genl_family. Take just read cb_lock for this task > as it is sufficient to guard the idr and the struct against > concurrent genl_register/unregister_family() calls. > > This will allow to run genl command processing in genl_rcv() and > mnl_socket_setsockopt(.., NETLINK_ADD_MEMBERSHIP, ..) in parallel. Not stable material, please drop.