public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Oliver Neukum <oliver@neukum•org>
To: "Bjørn Mork" <bjorn@mork•no>
Cc: linux-usb@vger•kernel.org, netdev@vger•kernel.org
Subject: Re: [PATCH net] net: usbnet: prevent buggy devices from killing us
Date: Fri, 25 Jan 2013 13:02:38 +0100	[thread overview]
Message-ID: <1659086.jLlTU1VIap@linux-5eaq.site> (raw)
In-Reply-To: <87ham5g2gk.fsf@nemi.mork.no>

On Friday 25 January 2013 08:13:15 Bjørn Mork wrote:
> Oliver Neukum <oliver@neukum•org> writes:
> > On Thursday 24 January 2013 20:16:56 Bjørn Mork wrote:
> >> A device sending 0 length frames as fast as it can has been
> >> observed killing the host system due to the resulting memory
> >> pressure.
> >> 
> >> Temporarily disable RX skb allocation and URB submission when
> >> the current error ratio is high, preventing us from trying to
> >> allocate an infinite number of skbs.  Reenable as soon as we
> >> are finished processing the done queue, allowing the device
> >> to continue working after short error bursts.
> >> 
> >> Signed-off-by: Bjørn Mork <bjorn@mork•no>
> >> ---
> >> So is this starting to look OK?
> >
> > It seems to me that we at least need to try some error recovery.
> 
> Won't the disabling code in usbnet_bh do? RX will only stay disabled
> until the done queue is handled.

So will the burst of bogus packets stop by itself?

> 
> > How about resetting the device when it is no longer used?
> 
> Yes, that we should do. I guess usbnet_open is the place to reset the
> flag and counters? I'll send another version taking care of this and
> Joes comment.

I was thinking about resetting the device, not just counters.
But yes, open() needs to reset the counters, too.

	Regards
		Oliver

  reply	other threads:[~2013-01-25 12:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-24 10:25 [RFC] net: usbnet: prevent buggy devices from killing us Bjørn Mork
     [not found] ` <1359023152-32576-1-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>
2013-01-24 10:46   ` Oliver Neukum
     [not found]     ` <6505263.QGCG9bfoCC-7ztolUikljGernLeA6q8OA@public.gmane.org>
2013-01-24 10:52       ` Bjørn Mork
     [not found]         ` <87bocehmzd.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
2013-01-24 11:03           ` Oliver Neukum
     [not found]             ` <2321910.EQLkSoxl50-7ztolUikljGernLeA6q8OA@public.gmane.org>
2013-01-24 11:22               ` Bjørn Mork
     [not found]                 ` <877gn2hlkh.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
2013-01-24 11:31                   ` Oliver Neukum
2013-01-24 12:47                     ` Bjørn Mork
     [not found]                       ` <87y5fig32r.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
2013-01-24 13:12                         ` Oliver Neukum
     [not found]                           ` <2556579.vjYlY1iKn5-7ztolUikljGernLeA6q8OA@public.gmane.org>
2013-01-24 13:42                             ` Bjørn Mork
2013-01-24 19:16                             ` [PATCH net] " Bjørn Mork
2013-01-24 22:09                               ` Oliver Neukum
2013-01-25  7:13                                 ` Bjørn Mork
2013-01-25 12:02                                   ` Oliver Neukum [this message]
     [not found]                                     ` <1659086.jLlTU1VIap-7ztolUikljGernLeA6q8OA@public.gmane.org>
2013-01-25 12:27                                       ` Bjørn Mork
     [not found]                               ` <1359055016-13603-1-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>
2013-01-24 23:57                                 ` Joe Perches
2013-01-25  8:14                                   ` Bjørn Mork
2013-01-24 10:47 ` [RFC] " Bjørn Mork
2013-01-24 12:39 ` Sergei Shtylyov
     [not found]   ` <51012B76.1060600-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org>
2013-01-24 13:01     ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1659086.jLlTU1VIap@linux-5eaq.site \
    --to=oliver@neukum$(echo .)org \
    --cc=bjorn@mork$(echo .)no \
    --cc=linux-usb@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox