Re: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack

2017-04-25 Thread Felipe Balbi
Hi, Greg Kroah-Hartman writes: > On Tue, Apr 25, 2017 at 01:35:33PM +0300, Maksim Salau wrote: >> > + } else if (object_is_on_stack(urb->transfer_buffer)) { >> > + WARN_ONCE(1, "transfer buffer is on stack\n"); >> > +

Re: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack

2017-04-25 Thread Felipe Balbi
Hi, Greg Kroah-Hartman writes: > On Tue, Apr 25, 2017 at 01:35:33PM +0300, Maksim Salau wrote: >> > + } else if (object_is_on_stack(urb->transfer_buffer)) { >> > + WARN_ONCE(1, "transfer buffer is on stack\n"); >> > + ret =

Re: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack

2017-04-25 Thread Greg Kroah-Hartman
On Tue, Apr 25, 2017 at 01:35:33PM +0300, Maksim Salau wrote: > > + } else if (object_is_on_stack(urb->transfer_buffer)) { > > + WARN_ONCE(1, "transfer buffer is on stack\n"); > > + ret = -EAGAIN; > > } else

Re: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack

2017-04-25 Thread Greg Kroah-Hartman
On Tue, Apr 25, 2017 at 01:35:33PM +0300, Maksim Salau wrote: > > + } else if (object_is_on_stack(urb->transfer_buffer)) { > > + WARN_ONCE(1, "transfer buffer is on stack\n"); > > + ret = -EAGAIN; > > } else

Re: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack

2017-04-25 Thread Maksim Salau
> + } else if (object_is_on_stack(urb->transfer_buffer)) { > + WARN_ONCE(1, "transfer buffer is on stack\n"); > + ret = -EAGAIN; > } else { Hi, Has anyone considered a fail-safe mode? I.e.: if a

Re: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack

2017-04-25 Thread Maksim Salau
> + } else if (object_is_on_stack(urb->transfer_buffer)) { > + WARN_ONCE(1, "transfer buffer is on stack\n"); > + ret = -EAGAIN; > } else { Hi, Has anyone considered a fail-safe mode? I.e.: if a

Re: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack

2017-04-24 Thread Alan Stern
On Sun, 23 Apr 2017, Florian Fainelli wrote: > We see a large number of fixes to several drivers to remove the usage of > on-stack buffers feeding into USB transfer functions. Make it easier to spot > the offenders by adding a warning in usb_hcd_map_urb_for_dma() checking that >

Re: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack

2017-04-24 Thread Alan Stern
On Sun, 23 Apr 2017, Florian Fainelli wrote: > We see a large number of fixes to several drivers to remove the usage of > on-stack buffers feeding into USB transfer functions. Make it easier to spot > the offenders by adding a warning in usb_hcd_map_urb_for_dma() checking that >

Re: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack

2017-04-24 Thread Clemens Ladisch
Florian Fainelli wrote: > We see a large number of fixes to several drivers to remove the usage of > on-stack buffers feeding into USB transfer functions. Make it easier to spot > the offenders by adding a warning in usb_hcd_map_urb_for_dma() checking that > urb->transfer_buffer is not a stack

Re: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack

2017-04-24 Thread Clemens Ladisch
Florian Fainelli wrote: > We see a large number of fixes to several drivers to remove the usage of > on-stack buffers feeding into USB transfer functions. Make it easier to spot > the offenders by adding a warning in usb_hcd_map_urb_for_dma() checking that > urb->transfer_buffer is not a stack

[PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack

2017-04-23 Thread Florian Fainelli
We see a large number of fixes to several drivers to remove the usage of on-stack buffers feeding into USB transfer functions. Make it easier to spot the offenders by adding a warning in usb_hcd_map_urb_for_dma() checking that urb->transfer_buffer is not a stack object. Signed-off-by: Florian

[PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack

2017-04-23 Thread Florian Fainelli
We see a large number of fixes to several drivers to remove the usage of on-stack buffers feeding into USB transfer functions. Make it easier to spot the offenders by adding a warning in usb_hcd_map_urb_for_dma() checking that urb->transfer_buffer is not a stack object. Signed-off-by: Florian