Re: usb/core: slab-out-of-bounds in usb_set_configuration

From: Greg Kroah-Hartman
Date: Tue Sep 19 2017 - 08:39:54 EST


On Tue, Sep 19, 2017 at 01:54:57PM +0200, Andrey Konovalov wrote:
> On Mon, Sep 18, 2017 at 8:50 PM, Greg Kroah-Hartman
> <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> > On Mon, Sep 18, 2017 at 07:22:24PM +0200, Andrey Konovalov wrote:
> >> Hi!
> >>
> >> I've got the following crash while fuzzing the kernel with syzkaller.
> >>
> >> On commit ebb2c2437d8008d46796902ff390653822af6cc4 (Sep 18).
> >>
> >> It seems there's no proper size check of a
> >> USB_DT_INTERFACE_ASSOCIATION descriptor. It's only checked that the
> >> size is >= 2 in usb_parse_configuration(), so find_iad() might do
> >> out-of-bounds access to intf_assoc->bInterfaceCount.
> >
> > Ah, nice catch!
> >
> > Does the patch below fix this?
>
> Hi Greg,
>
> I believe it does and the bug is no longer triggered with the
> reproducer that I have.
>
> Tested-by: Andrey Konovalov <andreyknvl@xxxxxxxxxx>

Thanks for testing, I'll go queue this up.

greg k-h