Re: [PATCH] USB: core: prevent malicious bNumInterfaces overflow

2017-12-13 Thread Alan Stern
On Wed, 13 Dec 2017, Greg KH wrote: > > > --- usb-4.x.orig/drivers/usb/core/config.c > > > +++ usb-4.x/drivers/usb/core/config.c > > > @@ -555,6 +555,9 @@ static int usb_parse_configuration(struc > > > unsigned iad_num = 0; > > > > > > memcpy(>desc, buffer, USB_DT_CONFIG_SIZE); > > > +

Re: [PATCH] USB: core: prevent malicious bNumInterfaces overflow

2017-12-13 Thread Greg KH
On Tue, Dec 12, 2017 at 02:25:13PM -0500, Alan Stern wrote: > A malicious USB device with crafted descriptors can cause the kernel > to access unallocated memory by setting the bNumInterfaces value too > high in a configuration descriptor. Although the value is adjusted > during parsing, this

Re: [PATCH] USB: core: prevent malicious bNumInterfaces overflow

2017-12-12 Thread Greg KH
On Wed, Dec 13, 2017 at 09:27:42AM +0800, Peter Chen wrote: > On Tue, Dec 12, 2017 at 02:25:13PM -0500, Alan Stern wrote: > > A malicious USB device with crafted descriptors can cause the kernel > > to access unallocated memory by setting the bNumInterfaces value too > > high in a configuration

Re: [PATCH] USB: core: prevent malicious bNumInterfaces overflow

2017-12-12 Thread Peter Chen
On Tue, Dec 12, 2017 at 02:25:13PM -0500, Alan Stern wrote: > A malicious USB device with crafted descriptors can cause the kernel > to access unallocated memory by setting the bNumInterfaces value too > high in a configuration descriptor. Although the value is adjusted > during parsing, this

[PATCH] USB: core: prevent malicious bNumInterfaces overflow

2017-12-12 Thread Alan Stern
A malicious USB device with crafted descriptors can cause the kernel to access unallocated memory by setting the bNumInterfaces value too high in a configuration descriptor. Although the value is adjusted during parsing, this adjustment is skipped in one of the error return paths. This patch