]> git.karo-electronics.de Git - karo-tx-linux.git/commit
greybus: operation: rate-limit dev_err printing on the receive path
authorEli Sennesh <esennesh@leaflabs.com>
Fri, 13 May 2016 17:27:40 +0000 (13:27 -0400)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 17 May 2016 16:21:10 +0000 (09:21 -0700)
commitb0e97bce153a416c4de4841078fba57b69de10f5
tree962ded7ebd5df4058211fd709fdcf61395a1c85a
parent3a238fc7844f93c799283d8b822178af9638ff0c
greybus: operation: rate-limit dev_err printing on the receive path

When we receive Greybus operations we don't recognize, requests or responses,
en masse, we can pile up a lot of dev_err() printk messages.  Doing so along
the gb_connection_recv() code path can delay receive processing by up to seven
milliseconds, starving the system of bulk-IN urbs.  Rate limit those printk
messages, ensuring that after too many repeated errors at the same place in
the code-path, we'll stop printing to the console at all and let the urbs get
returned.

This will help prevent denial-of-service attacks on the AP through the UniPro
network from malicious or malfunctioning modules.

Testing Done: 7 msec recv-to-resubmit-urb processing times go down to <20
usecs

Signed-off-by: Eli Sennesh <esennesh@leaflabs.com>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Mitchell Tasman <tasman@leaflabs.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/operation.c