[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20071003081213.4676ae60@laptopd505.fenrus.org>
Date: Wed, 3 Oct 2007 08:12:13 -0700
From: Arjan van de Ven <arjan@...radead.org>
To: Al Viro <viro@....linux.org.uk>
Cc: Ingo Molnar <mingo@...e.hu>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Greg KH <gregkh@...e.de>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [bug] crash when reading /proc/mounts (was: Re: Linux
2.6.23-rc9 and a heads-up for the 2.6.24 series..)
On Wed, 3 Oct 2007 15:26:01 +0100
Al Viro <viro@....linux.org.uk> wrote:
> On Wed, Oct 03, 2007 at 04:08:42PM +0200, Ingo Molnar wrote:
> > > Charming... So we get d_path() either returning junk or we get
> > > something that isn't NUL-terminated. Which one it is? I.e. what
> > > does p look like and what's in s?
> >
> > could be use-after-free as well, as CONFIG_PAGEALLOC was enabled.
>
> Umm... d_path() had just written there, so use-after-free is not too
> likely to trigger page fault on read immediately afterwards - you'd
> need a pretty tight race to hit it.
I suspect we want the following patch out of general principles; Ingo,
can you see if this one helps?
(if not, it's still worth considering; it looks like we're first
destroying the device object (which holds the name of the directory)
before we unregister the directory... if that fails then we have a mess.
Signed-off-by: Arjan van de Ven <arjan@...ux.intel.com>
--- linux-2.6.23-rc2/net/wireless/core.c~ 2007-10-03 08:04:45.000000000 -0700
+++ linux-2.6.23-rc2/net/wireless/core.c 2007-10-03 08:04:45.000000000 -0700
@@ -133,8 +133,8 @@ void wiphy_unregister(struct wiphy *wiph
mutex_unlock(&drv->mtx);
list_del(&drv->list);
- device_del(&drv->wiphy.dev);
debugfs_remove(drv->wiphy.debugfsdir);
+ device_del(&drv->wiphy.dev);
mutex_unlock(&cfg80211_drv_mutex);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists