taprio: Fix allowing too small intervals
authorVinicius Costa Gomes <vinicius.gomes@intel.com>
Thu, 10 Sep 2020 00:03:11 +0000 (17:03 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Sep 2020 16:05:24 +0000 (18:05 +0200)
commit817ff50796c5e364c879596509f83fcba194bb6f
treefd2dc10e99ee39afd1dbc6fbebd64dee37292f45
parentb193ee2ad41716e8a933baa46f774d50c6756d8d
taprio: Fix allowing too small intervals

[ Upstream commit b5b73b26b3ca34574124ed7ae9c5ba8391a7f176 ]

It's possible that the user specifies an interval that couldn't allow
any packet to be transmitted. This also avoids the issue of the
hrtimer handler starving the other threads because it's running too
often.

The solution is to reject interval sizes that according to the current
link speed wouldn't allow any packet to be transmitted.

Reported-by: syzbot+8267241609ae8c23b248@syzkaller.appspotmail.com
Fixes: 5a781ccbd19e ("tc: Add support for configuring the taprio scheduler")
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sched/sch_taprio.c