Re: NULL pointer dereference in sysfs_readdir

From: Michael Buesch
Date: Sun Oct 22 2006 - 06:56:56 EST


On Sunday 22 October 2006 11:08, Stefan Richter wrote:
> > Yeah, I found that offset, too, but:
> >
> > There is only one usage of s_dentry
> > if (next->s_dentry)
> >
> > But _before_ that there already comes
> > if (!next->s_element)
> >
> > So, if "next" was NULL, it would already oops there.
>
> What if "next" became NULL afterwards?

Hm, yeah. Makes kind of sense.

> I know it's unlikely (but so is
> the whole bug, given that we have just one reporter despite the bug's
> age), but is it impossible? IOW does sysfs_readdir have any indirect
> mutex protection?

I think it's protected by the BKL, but I dunno if that's sufficient here.

--
Greetings Michael.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/