linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re:Badness in vsnprintf
@ 2006-02-26 13:05 Chuck Ebbert
  0 siblings, 0 replies; only message in thread
From: Chuck Ebbert @ 2006-02-26 13:05 UTC (permalink / raw)
  To: Horst Schirmeier
  Cc: Dmitry Torokhov, linux-kernel, Vojtech Pavlik, Kay Sievers

In-Reply-To: <20060126195038.GB22994@quickstop.soohrt.org>

On Thu, 26 Jan 2006 at 20:50:38 +0100, Horst Schirmeier wrote:

> input: USB HID v1.10 Keyboard [Logitech USB Receiver] on usb-0000:00:04.2-1
> Badness in vsnprintf at lib/vsprintf.c:279
>  [<c0324f64>] vsnprintf+0x544/0x550
>  [<c0324fbc>] snprintf+0x1c/0x30
>  [<c03ec17a>] print_modalias_bits+0x8a/0x90
>  [<c03ec213>] print_modalias+0x93/0x1d0
>  [<c03ec8c0>] input_dev_uevent+0x1d0/0x4b0
>  [<c0384060>] class_uevent+0xb0/0x260
>  [<c0383fb0>] class_uevent+0x0/0x260
>  [<c03223f1>] kobject_uevent+0x3f1/0x450

print_modalias() passed a negative length to snprintf().

There's a general lack of error checking in the whole area;
input_dev_uevent() does:

        envp[i++] = buffer + len;
        len += snprintf(buffer + len, buffer_size - len, "MODALIAS=");
        len += print_modalias(buffer + len, buffer_size - len, dev) + 1;

        envp[i] = NULL;

and never checks whether 'buffer_size - len' is negative or even if there
is space in envp[] for another pointer.  And print_modalias() and
print_modalias_bits() don't check anything either.

Maybe the modalias shouldn't be in there at all since there doesn't seem to
be enough space for it?

-- 
Chuck
"Equations are the Devil's sentences."  --Stephen Colbert


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-02-26 13:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-26 13:05 Re:Badness in vsnprintf Chuck Ebbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).