lkml.org 
[lkml]   [2017]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack
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 {
>
> Hi,
>
> Has anyone considered a fail-safe mode? I.e.: if a buffer is on stack,
> kmemdup it and continue with a warning. This will give us both: functional
> drivers (with possibly decreased efficiency in speed and memory footprint)
> and warnings for developers that a particular driver requires attention.

No, I do not want that, let's fix the drivers.

> This mode will not affect drivers which obey the rules, but will make
> offenders at least functional. My main concern is that not every user is able
> to detect and report a problem, which prevents drivers from functioning.
> Especially this is a problem for not wide spread devices.
> Due to this users a seeing unusable equipment, but developers are not
> aware of those, even if fixes are trivial.
>
> Such mode has a also a negative effect: if a developer has a device
> with an offending driver, he can miss the warning message, since the driver
> just works.

Exactly, let's fix the bugs. These have been bugs for 10+ years now,
they should get fixed, it's not complex :)

thanks,

greg k-h

\
 
 \ /
  Last update: 2017-04-25 13:59    [W:0.287 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site