Re: Fw: Re: oops in choose_configuration()

From: Greg KH
Date: Tue Mar 07 2006 - 20:25:37 EST


On Tue, Mar 07, 2006 at 08:13:28PM -0500, Dmitry Torokhov wrote:
> On Tuesday 07 March 2006 19:57, Linus Torvalds wrote:
> >
> > On Tue, 7 Mar 2006, Chuck Ebbert wrote:
> > >
> > > At least one susbsystem rolls its own method of adding env vars to the
> > > uevent buffer, and it's so broken it triggers the WARN_ON() in
> > > lib/vsprintf.c::vsnprintf() by passing a negative length to that function.
> >
> > Well, snprintf() should be safe, though. It will warn if the caller is
> > lazy, but these days, the thing does
> >
> > max(buf_size - len, 0)
> >
> > which should mean that the input layer passes in 0 instead of a negative
> > number. And snprintf() will then _not_ print anything.
> >
> > So I think input_add_uevent_bm_var() is safe, even if it's not pretty.
> >
> > However, input_devices_read() doesn't do any sanity checking at all, and
> > if that ever ends up printing more than a page, that would be bad. I
> > didn't look very closely, but it looks worrisome.
> >
> > Dmitry?
>
> I had all this code converted to seq_file, but it depends on converting
> input handlers to class interfaces and it is not possible nowadays
> because with latest Greg's changes to class code we would try to
> register class devices while registering class devices/interfaces
> (psmouse creates input_dev which binds to mousedev interface which in
> turn tries to create mouseX which is also belongs to input class) and
> deadlocking. Greg promised current implementation is only a temporary
> solution.
>
> I suppose I could separate those changes...

That would probably be a good idea :)

Oh, and I have been working on makeing the correct fix, you can see the
initial try of it at:
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/device-class.patch
if you are really brave :)

thanks,

greg k-h
-
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/