Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1454940rwl; Fri, 31 Mar 2023 11:20:39 -0700 (PDT) X-Google-Smtp-Source: AKy350YczZLFxa2uvSqQJfpabGa3yOvhmdf2tfZOUNDs81PqwwSW1H37puBHCUzkt1bANRClGPf4 X-Received: by 2002:a17:903:41cb:b0:1a2:9940:1f75 with SMTP id u11-20020a17090341cb00b001a299401f75mr4481807ple.0.1680286839229; Fri, 31 Mar 2023 11:20:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680286839; cv=none; d=google.com; s=arc-20160816; b=T01azpzpS+O5FMOjIcryRlRXAlbn4wzE2RIGLiSgVzLHXrXpBQGszfTgEeEILdA3v+ T0xnMyCCPMhmiA0XBXEJzDDsRyashqvSZTSXdR/ShckQRxuQHsePNJQQGdFMHDRRjUuu f0JricAeiY0XOJD+tDIaxumEcESyZJqBEpm9Ko6wYR60PM0nYXVtq8urdgqF0tktgtEC OlP9NJ+gjBs1xo+5n5K02V+5KKRR56IgKvvDt8cD8NbpLThTq9K25+LjGUinFp1tjAMa 5EOK1WF82jcMk1FFDkyXt4y7GzyJDCN+/zVqRO/nQx/jzU+3N7xoIVQJScoUNeGiSvpa 2fjw== 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=gi1sjbTKdnugRO+PL96kuSl9ZpkullYMQIRnMD+4opM=; b=II25kJJiIJSXXTXTwqMmqalqh8J3i6ciXGrGGG4Ri8za96108lYc+lT3M4jJFK6PCS BxJZzkNpMGug6yUlWDys41fkSTN8TjRTMkxGZ2DySf0RUZFWdSinCDTB/Ps5e2oNm55b ozbhuLJzwBRsaePU2UdFBKKfJ4kk/SwZwUJK9Lf4i7kyC8T0qjA5lAv61PciMi5QwFmX MqAoBdQ+Mlh98LxYgfqu+sYi13kmVYC+ArVIntnIAtZZvQkcE/6YajvDNGf1TlsD5yJN wQL1dZpHF4r2a3H79RJDKlyU9B78Bo3l6UU1JlMuiAeikT7xB2yI4HN4gy13um4XkOsd E0ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iKqeZgwj; 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 y1-20020a1709027c8100b00194a5108613si2654118pll.177.2023.03.31.11.19.57; Fri, 31 Mar 2023 11:20:39 -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=iKqeZgwj; 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 S232766AbjCaSNb (ORCPT + 99 others); Fri, 31 Mar 2023 14:13:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229967AbjCaSN3 (ORCPT ); Fri, 31 Mar 2023 14:13:29 -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 1C3BDDBE3; Fri, 31 Mar 2023 11:13:28 -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 AB2D162AEE; Fri, 31 Mar 2023 18:13:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96B25C433EF; Fri, 31 Mar 2023 18:13:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680286407; bh=gi1sjbTKdnugRO+PL96kuSl9ZpkullYMQIRnMD+4opM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=iKqeZgwj7/oZFEgZi7luiiKzaSpuMx4JhHjR5zsxW49lod4nmNZh3dg7P1xAG7hBK oplDtMkzTPCHMkgmCyWv8pE0fAETRZiqUmhSWrFfVf8/3Iabzyq0Z+oSM9NQZ1Fbwd CEf05F98mgwLpd0xKBdH5dN5BYMAtWzXYVv0q3nx9XVL5yw9qMt3YyMz1fEMI0M06O Cg7SozlIBwZoTskYzzcYgqh6iBzP0QwTPr5hw4cH3Lt9hynzt9yiBfi3VRsqaMR98e ewwrhvZQ5tD5fnMP32Y362Q78jal1DHerccan2usf0sGUlf8aOFN37tgNtEnMwz7nS 3KK8j4m+O1CfA== Date: Fri, 31 Mar 2023 11:13:25 -0700 From: Jakub Kicinski To: Anjali Kulkarni Cc: "davem@davemloft.net" , "edumazet@google.com" , "pabeni@redhat.com" , "zbr@ioremap.net" , "brauner@kernel.org" , "johannes@sipsolutions.net" , "ecree.xilinx@gmail.com" , "leon@kernel.org" , "keescook@chromium.org" , "socketcan@hartkopp.net" , "petrm@nvidia.com" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" Subject: Re: [PATCH v3 6/7] netlink: Add multicast group level permissions Message-ID: <20230331111325.5703499b@kernel.org> In-Reply-To: References: <20230329182543.1161480-1-anjali.k.kulkarni@oracle.com> <20230329182543.1161480-7-anjali.k.kulkarni@oracle.com> <20230330233941.70c98715@kernel.org> <830EC978-8B94-42D6-B70F-782724CEC82D@oracle.com> <20230331102454.1251a97f@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 Fri, 31 Mar 2023 17:48:18 +0000 Anjali Kulkarni wrote: > > On Mar 31, 2023, at 10:24 AM, Jakub Kicinski wrote: > > On Fri, 31 Mar 2023 17:00:27 +0000 Anjali Kulkarni wrote: =20 > >> Are you suggesting adding something like a new struct proto_ops for > >> the connector family? I have not looked into that, though that would > >> seem like a lot of work, and also I have not seen any infra structure > >> to call into protocol specific bind from netlink bind? =20 > >=20 > > Where you're adding a release callback in patch 2 - there's a bind > > callback already three lines above. What am I missing? =20 > Ah yes, that one is actually meant to be used for adding(bind) and > deleting(unbind) multicast group memberships. So it is also called > from setsockopt() - so I think just checking for root access > permission changes the semantics of what it is meant to be used for? > Besides we would need to change some of that ordering there (check > for permissions & netlink_bind call) and changing it for all users of > netlink might not be a good idea=E2=80=A6? AFAICT genetlink uses that callback in the way I'm suggesting already (see genl_bind()) so if you can spot a bug or a problem - we need to fix it :S