All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Haller <thaller@redhat.com>
To: Mat Martineau <mathew.j.martineau@linux.intel.com>
Cc: mptcp@lists.linux.dev, Paolo Abeni <pabeni@redhat.com>,
	Florian Westphal <fw@strlen.de>,
	Matthieu Baerts <matthieu.baerts@tessares.net>
Subject: Re: [PATCH] mptcp: allow priviledged operations from user namespaces
Date: Tue, 09 Aug 2022 12:23:44 +0200	[thread overview]
Message-ID: <61c4ce025d140659e34c14b2180378f48f45839e.camel@redhat.com> (raw)
In-Reply-To: <e95949bf-53cf-bdf-27c8-8cbc3eeda450@linux.intel.com>

Hi Mat,

On Mon, 2022-08-08 at 17:04 -0700, Mat Martineau wrote:
> On Fri, 5 Aug 2022, Thomas Haller wrote:
> 
> > GENL_ADMIN_PERM checks that the user has CAP_NET_ADMIN in the
> > initial
> > namespace by calling netlink_capable(). Instead, use
> > GENL_UNS_ADMIN_PERM
> > which uses netlink_ns_capable(). This checks that the caller has
> > CAP_NET_ADMIN in the current user namespace.
> > 
> > See also commit 4a92602aa1cd ('openvswitch: allow management from
> > inside
> > user namespaces') which introduced this mechanism. See also commit
> > 5617c6cd6f84 ('nl80211: Allow privileged operations from user
> > namespaces'), which introduced this for nl80211.
> > 
> > Signed-off-by: Thomas Haller <thaller@redhat.com>
> 
> Hi Thomas -
> 
> Thanks for the patch! This does seem like a good idea to me (and it
> seems 
> to work ok with our MPTCP tests), but I'd like to get some more
> community 
> input before merging (Paolo/Florian?).

thanks for your feedback.

The background for this is that we run unit tests for NetworkManager in
a separate network namespace, started as non-root user. Configuring
MPTCP endpoints does currently not work in that environment.


> We also need to figure out which branch this belongs in (we usually
> tag 
> the patch subject with [PATCH mptcp-net] or [PATCH mptcp-next] to
> indicate 
> this). If we upstream it to the net branch it will get in to 6.0-rcX
> and 
> be eligible for backporting to the stable branches. Looks like it
> would 
> need manual backporting to pre-5.19 kernels due to the incremental
> changes 
> to mptcp_pm_ops over time.

> To upstream this to net it also needs a Fixes tag:
> 
> Fixes: 702c2f646d42 ("mptcp: netlink: allow userspace-driven subflow
> establishment")


> Thomas, do you have any thoughts/preferences on upstreaming to net or
> net-next?

I don't have a strong opinion or need. Thanks for explaining the
process.

Ffrom what you said, it sounds as this would make sense as [PATCH
mptcp-net]. I will send a v2 with the "Fixes:" line.



Thomas

> > ---
> > net/mptcp/pm_netlink.c | 18 +++++++++---------
> > 1 file changed, 9 insertions(+), 9 deletions(-)
> > 
> > diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> > index 291b5da42fdb..2c145cdc7bdc 100644
> > --- a/net/mptcp/pm_netlink.c
> > +++ b/net/mptcp/pm_netlink.c
> > @@ -2218,17 +2218,17 @@ static const struct genl_small_ops
> > mptcp_pm_ops[] = {
> >         {
> >                 .cmd    = MPTCP_PM_CMD_ADD_ADDR,
> >                 .doit   = mptcp_nl_cmd_add_addr,
> > -               .flags  = GENL_ADMIN_PERM,
> > +               .flags  = GENL_UNS_ADMIN_PERM,
> >         },
> >         {
> >                 .cmd    = MPTCP_PM_CMD_DEL_ADDR,
> >                 .doit   = mptcp_nl_cmd_del_addr,
> > -               .flags  = GENL_ADMIN_PERM,
> > +               .flags  = GENL_UNS_ADMIN_PERM,
> >         },
> >         {
> >                 .cmd    = MPTCP_PM_CMD_FLUSH_ADDRS,
> >                 .doit   = mptcp_nl_cmd_flush_addrs,
> > -               .flags  = GENL_ADMIN_PERM,
> > +               .flags  = GENL_UNS_ADMIN_PERM,
> >         },
> >         {
> >                 .cmd    = MPTCP_PM_CMD_GET_ADDR,
> > @@ -2238,7 +2238,7 @@ static const struct genl_small_ops
> > mptcp_pm_ops[] = {
> >         {
> >                 .cmd    = MPTCP_PM_CMD_SET_LIMITS,
> >                 .doit   = mptcp_nl_cmd_set_limits,
> > -               .flags  = GENL_ADMIN_PERM,
> > +               .flags  = GENL_UNS_ADMIN_PERM,
> >         },
> >         {
> >                 .cmd    = MPTCP_PM_CMD_GET_LIMITS,
> > @@ -2247,27 +2247,27 @@ static const struct genl_small_ops
> > mptcp_pm_ops[] = {
> >         {
> >                 .cmd    = MPTCP_PM_CMD_SET_FLAGS,
> >                 .doit   = mptcp_nl_cmd_set_flags,
> > -               .flags  = GENL_ADMIN_PERM,
> > +               .flags  = GENL_UNS_ADMIN_PERM,
> >         },
> >         {
> >                 .cmd    = MPTCP_PM_CMD_ANNOUNCE,
> >                 .doit   = mptcp_nl_cmd_announce,
> > -               .flags  = GENL_ADMIN_PERM,
> > +               .flags  = GENL_UNS_ADMIN_PERM,
> >         },
> >         {
> >                 .cmd    = MPTCP_PM_CMD_REMOVE,
> >                 .doit   = mptcp_nl_cmd_remove,
> > -               .flags  = GENL_ADMIN_PERM,
> > +               .flags  = GENL_UNS_ADMIN_PERM,
> >         },
> >         {
> >                 .cmd    = MPTCP_PM_CMD_SUBFLOW_CREATE,
> >                 .doit   = mptcp_nl_cmd_sf_create,
> > -               .flags  = GENL_ADMIN_PERM,
> > +               .flags  = GENL_UNS_ADMIN_PERM,
> >         },
> >         {
> >                 .cmd    = MPTCP_PM_CMD_SUBFLOW_DESTROY,
> >                 .doit   = mptcp_nl_cmd_sf_destroy,
> > -               .flags  = GENL_ADMIN_PERM,
> > +               .flags  = GENL_UNS_ADMIN_PERM,
> >         },
> > };
> > 
> > -- 
> > 2.37.1
> > 
> > 
> > 
> 
> --
> Mat Martineau
> Intel
> 


  reply	other threads:[~2022-08-09 10:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-05 11:50 [PATCH] mptcp: allow priviledged operations from user namespaces Thomas Haller
2022-08-05 13:37 ` mptcp: allow priviledged operations from user namespaces: Tests Results MPTCP CI
2022-08-09  0:04 ` [PATCH] mptcp: allow priviledged operations from user namespaces Mat Martineau
2022-08-09 10:23   ` Thomas Haller [this message]
2022-08-09 10:25   ` Florian Westphal
2022-08-09 11:16     ` Florian Westphal
2022-08-10  7:42   ` [PATCH mptcp-next v2 1/2] " Thomas Haller
2022-08-10  7:42     ` [PATCH mptcp-next v2 2/2] mptcp: account memory allocation in mptcp_nl_cmd_add_addr() to user Thomas Haller
2022-08-10 23:14       ` Mat Martineau
2022-08-10 23:08     ` [PATCH mptcp-next v2 1/2] mptcp: allow priviledged operations from user namespaces Mat Martineau
2022-08-11 10:34       ` Matthieu Baerts
2022-08-24 20:37         ` Thomas Haller
2022-08-29 15:13           ` Matthieu Baerts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=61c4ce025d140659e34c14b2180378f48f45839e.camel@redhat.com \
    --to=thaller@redhat.com \
    --cc=fw@strlen.de \
    --cc=mathew.j.martineau@linux.intel.com \
    --cc=matthieu.baerts@tessares.net \
    --cc=mptcp@lists.linux.dev \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.