Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DCABC48CC1; Wed, 20 Dec 2023 19:47:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MldE3lCL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B636C433C7; Wed, 20 Dec 2023 19:47:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703101638; bh=SvR08pJSv1fMG1aYuyzwnVSg2LeMS9zvV8dA/9nMRYA=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=MldE3lCLoi/EpoxEXdCyGslvy/VW6URzDeZrdqU/DQOh4fCTEE0/QpqKI3k1UP6j8 WkBj+Hopkz57N/o+t+5/U8kcbpEgM/XgNEI/03/EcaX2zDOHOWVQj5PRPVTUyuEcb6 o3RRxJwZoZ7DV4WjotKkTAfENlPeMPgII1H79nRHf2nPNNo/A6eE0b+luOHlyN59+l R0qnin/B9YcZrz9rO8dBTQRbpiZL4ukeATlu4BCIMzYY8IgzKQ5Eyfr2/48ZQf8NqW /5DvfCMPIOb2IKEzqzQAG7TImalzihYptB6MycTE/sVtz5El9XfSmXAAO7eN8FH7Bb 1CV4G80JJU19w== Date: Wed, 20 Dec 2023 11:47:17 -0800 (PST) From: Mat Martineau To: Ido Schimmel cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, nhorman@tuxdriver.com, matttbe@kernel.org, yotam.gi@gmail.com, jiri@resnulli.us, jacob.e.keller@intel.com, johannes@sipsolutions.net, andriy.shevchenko@linux.intel.com, fw@strlen.de Subject: Re: [PATCH net-next v2] genetlink: Use internal flags for multicast groups In-Reply-To: <20231220154358.2063280-1-idosch@nvidia.com> Message-ID: <1cce66bc-af3f-97d8-f898-130e81fcfcff@kernel.org> References: <20231220154358.2063280-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII On Wed, 20 Dec 2023, Ido Schimmel wrote: > As explained in commit e03781879a0d ("drop_monitor: Require > 'CAP_SYS_ADMIN' when joining "events" group"), the "flags" field in the > multicast group structure reuses uAPI flags despite the field not being > exposed to user space. This makes it impossible to extend its use > without adding new uAPI flags, which is inappropriate for internal > kernel checks. > > Solve this by adding internal flags (i.e., "GENL_MCAST_*") and convert > the existing users to use them instead of the uAPI flags. > > Tested using the reproducers in commit 44ec98ea5ea9 ("psample: Require > 'CAP_NET_ADMIN' when joining "packets" group") and commit e03781879a0d > ("drop_monitor: Require 'CAP_SYS_ADMIN' when joining "events" group"). > > No functional changes intended. > > Signed-off-by: Ido Schimmel > --- > v2: > * Add a comment for each flag > --- > include/net/genetlink.h | 9 ++++++--- > net/core/drop_monitor.c | 2 +- > net/mptcp/pm_netlink.c | 2 +- Thanks Ido. For the mptcp change: Reviewed-by: Mat Martineau > net/netlink/genetlink.c | 4 ++-- > net/psample/psample.c | 2 +- > 5 files changed, 11 insertions(+), 8 deletions(-)