Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1630433
| Path | csiph.com!news.redatomik.org!weretis.net!feeder4.news.weretis.net!news.unit0.net!news.panservice.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack |
| Date | Tue, 25 Apr 2017 14:00:01 +0200 |
| Message-ID | <tA7ip-4eL-3@gated-at.bofh.it> (permalink) |
| References | <tzB8R-8mO-5@gated-at.bofh.it> <tA630-3ve-23@gated-at.bofh.it> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.8.2 (2017-04-18) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 32 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Florian Fainelli <f.fainelli@gmail.com>, linux-kernel@vger.kernel.org, arnd@arndb.de, Alan Stern <stern@rowland.harvard.edu>, Mathias Nyman <mathias.nyman@linux.intel.com>, Peter Chen <peter.chen@nxp.com>, Roger Quadros <rogerq@ti.com>, Baoyou Xie <baoyou.xie@linaro.org>, Sekhar Nori <nsekhar@ti.com>, Chris Bainbridge <chris.bainbridge@gmail.com>, Wolfram Sang <wsa-dev@sang-engineering.com>, "open list:USB SUBSYSTEM" <linux-usb@vger.kernel.org> |
| X-Original-Date | Tue, 25 Apr 2017 12:37:52 +0100 |
| X-Original-Message-ID | <20170425113752.GC7191@kroah.com> |
| X-Original-References | <20170424012939.29929-1-f.fainelli@gmail.com> <20170425133533.52ba1cb6@gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1630433 |
Show key headers only | View raw
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack Florian Fainelli <f.fainelli@gmail.com> - 2017-04-24 03:40 +0200
Re: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack Clemens Ladisch <clemens@ladisch.de> - 2017-04-24 09:30 +0200
Re: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack Alan Stern <stern@rowland.harvard.edu> - 2017-04-24 15:30 +0200
Re: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack Maksim Salau <maksim.salau@gmail.com> - 2017-04-25 12:40 +0200
Re: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-04-25 14:00 +0200
Re: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack Felipe Balbi <felipe.balbi@linux.intel.com> - 2017-04-25 15:30 +0200
csiph-web