All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: pull-request: mac80211-next 2012-07-10
Date: Thu, 12 Jul 2012 12:08:17 +0200	[thread overview]
Message-ID: <1342087697.4531.14.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1342087211.4531.12.camel@jlt3.sipsolutions.net> (sfid-20120712_120018_674592_22967432)

On Thu, 2012-07-12 at 12:00 +0200, Johannes Berg wrote:

> > Ok the bug is this -- if we remove a wdev (that doesn't have a netdev),
> > this change is obviously needed:

Better just handle the special case, I'm rolling this into the patch
"cfg80211: use wireless_dev for interface management":


--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2030,6 +2030,16 @@ static int nl80211_del_interface(struct sk_buff *skb, struct genl_info *info)
 	if (!rdev->ops->del_virtual_intf)
 		return -EOPNOTSUPP;
 
+	/*
+	 * If we remove a wireless device without a netdev then clear
+	 * user_ptr[1] so that nl80211_post_doit won't dereference it
+	 * to check if it needs to do dev_put(). Otherwise it crashes
+	 * since the wdev has been freed, unlike with a netdev where
+	 * we need the dev_put() for the netdev to really be freed.
+	 */
+	if (!wdev->netdev)
+		info->user_ptr[1] = NULL;
+
 	return rdev->ops->del_virtual_intf(&rdev->wiphy, wdev);
 }
 
johannes


  reply	other threads:[~2012-07-12 10:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-10 18:48 pull-request: mac80211-next 2012-07-10 Johannes Berg
2012-07-12  9:27 ` Johannes Berg
2012-07-12  9:56   ` Johannes Berg
2012-07-12 10:00     ` Johannes Berg
2012-07-12 10:08       ` Johannes Berg [this message]
2012-07-12 10:15 ` pull-request: mac80211-next 2012-07-12 Johannes Berg
2012-07-12 12:41   ` 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=1342087697.4531.14.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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.