All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Martin Willi <martin@strongswan.org>
Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH 2/2] mac80211_hwsim: Allow managing radios from non-initial namespaces
Date: Mon, 09 May 2016 09:30:45 +0200	[thread overview]
Message-ID: <1462779045.30690.2.camel@sipsolutions.net> (raw)
In-Reply-To: <1462350799.2546.31.camel@strongswan.org>

On Wed, 2016-05-04 at 10:33 +0200, Martin Willi wrote:

> > This changes today's default behaviour of moving the wiphys to the
> > default namespace. Did you intend to destroy them based on the
> > netgroup, i.e. based on the namespace that created them? Actually,
> > maybe they should move back to the namespace that created them, if
> > the namespace they are in is destroyed? But that's difficult, I
> > don't
> > mind this behaviour, but I'm not sure it's what we want by default
> > for radios created in the init_net.
> With the proposed approach I destroy all radios if the owning
> namespace gets deleted, because we probably don't want them landing
> in init_net if they are created from a (unprivileged) userns process.

I agree they shouldn't land in init_net.

> I think this is what other "virtual" interfaces do (gre tunnels, veth
> etc.). If we think of hwsim radios as such a "virtual" device, that
> makes IMO sense to delete them.

Ok, I have no idea what happens there.

> If we want to keep the existing behavior, we could move radios
> belonging to the init_net-associated netgroup back to init_net, that
> shouldn't be too difficult.
> 
> Moving the radio back to the creators namespace would be the most
> consistent behavior, so I'll check how difficult such a reverse
> lookup is. We then would delete the radio only if it is in the
> creators namespace, or if the creators namespace is gone. Does that
> make sense?

It does make sense, but it does also feel a bit complicated. Perhaps
just special-case the init_net case for consistency with the existing
behaviour, and reserve netgroup 0 for that so we can easily check for
it?

johannes

  reply	other threads:[~2016-05-09  7:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-03  6:53 [PATCH 0/2] wireless: Allow wiphy/hwsim management from user namespaces Martin Willi
2016-05-03  6:53 ` Martin Willi
2016-05-03  6:53 ` [PATCH 1/2] nl80211: Allow privileged operations " Martin Willi
2016-05-03  6:53 ` [PATCH 2/2] mac80211_hwsim: Allow managing radios from non-initial namespaces Martin Willi
2016-05-03  6:56   ` Johannes Berg
2016-05-03  7:50     ` Martin Willi
2016-05-03 19:16   ` Johannes Berg
2016-05-03 19:16     ` Johannes Berg
2016-05-04  8:33     ` Martin Willi
2016-05-04  8:33       ` Martin Willi
2016-05-09  7:30       ` Johannes Berg [this message]
2016-05-09 16:33         ` Martin Willi
2016-05-09 16:33           ` Martin Willi
2016-05-05 10:16   ` David Laight
2016-05-09  7:31     ` Johannes Berg
2016-05-09  7:31       ` Johannes Berg

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=1462779045.30690.2.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=martin@strongswan.org \
    --cc=netdev@vger.kernel.org \
    /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.