All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Arend van Spriel <arend@broadcom.com>
Cc: linux-wireless@vger.kernel.org, j@w1.fi
Subject: Re: [RFC] cfg80211: allow userspace to take ownership of interfaces
Date: Mon, 24 Mar 2014 18:45:57 +0100	[thread overview]
Message-ID: <1395683157.4276.0.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <53306CC7.2010709@broadcom.com>

On Mon, 2014-03-24 at 18:35 +0100, Arend van Spriel wrote:

> > To avoid this problem, introduce an ownership concept for interfaces. If
> > an interface is owned by a netlink socket, then it will be destroyed if
> > the netlink socket is closed for any reason, including if the process it
> > belongs to crashed. This gives us a race-free way to get rid of any such
> > interfaces.
> 
> Excellent idea.

:)

> > + * @NL80211_ATTR_IFACE_SOCKET_OWNER: flag attribute, if set during interface
> > + *	creation then the new interface will be owned by the netlink socket
> > + *	that created it and will be destroyed when the socket is closed
> > + *
> 
> Guess you want explicit flag so apps like iw can still create 
> interfaces, right?

Right, otherwise iw exits and the interface is destroyed immediately (I
did that for my testcase :) )

> > @@ -11662,6 +11675,19 @@ static int nl80211_netlink_notify(struct notifier_block * nb,
> >   			}
> >   		}
> >   		spin_unlock_bh(&rdev->beacon_registrations_lock);
> > +
> > +		if (schedule_destroy_work) {
> > +			struct cfg80211_iface_destroy *destroy;
> > +
> > +			destroy = kzalloc(sizeof(*destroy), GFP_ATOMIC);
> 
> Probably overlooking it, because it is not part of the patch but: what 
> lock requires this to be atomic? rcu_read_lock?

yes, but even if we moved it out it wouldn't help since it's an atomic
notifier chain

johannes


      reply	other threads:[~2014-03-24 17:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-24 16:57 [RFC] cfg80211: allow userspace to take ownership of interfaces Johannes Berg
2014-03-24 17:35 ` Arend van Spriel
2014-03-24 17:45   ` Johannes Berg [this message]

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=1395683157.4276.0.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=arend@broadcom.com \
    --cc=j@w1.fi \
    --cc=linux-wireless@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.