summaryrefslogtreecommitdiff
path: root/net/sched/cls_matchall.c
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2024-05-27 18:39:55 +0300
committerJakub Kicinski <kuba@kernel.org>2024-05-28 19:46:41 -0700
commitfb66df20a7201e60f2b13d7f95d031b31a8831d3 (patch)
treeadaf982615c1efa41f6adbd2d0c633faf6283c00 /net/sched/cls_matchall.c
parente634134180885574d1fe7aa162777ba41e7fcd5b (diff)
net/sched: taprio: extend minimum interval restriction to entire cycle too
It is possible for syzbot to side-step the restriction imposed by the blamed commit in the Fixes: tag, because the taprio UAPI permits a cycle-time different from (and potentially shorter than) the sum of entry intervals. We need one more restriction, which is that the cycle time itself must be larger than N * ETH_ZLEN bit times, where N is the number of schedule entries. This restriction needs to apply regardless of whether the cycle time came from the user or was the implicit, auto-calculated value, so we move the existing "cycle == 0" check outside the "if "(!new->cycle_time)" branch. This way covers both conditions and scenarios. Add a selftest which illustrates the issue triggered by syzbot. Fixes: b5b73b26b3ca ("taprio: Fix allowing too small intervals") Reported-by: syzbot+a7d2b1d5d1af83035567@syzkaller.appspotmail.com Closes: https://lore.kernel.org/netdev/0000000000007d66bc06196e7c66@google.com/ Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://lore.kernel.org/r/20240527153955.553333-2-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/sched/cls_matchall.c')
0 files changed, 0 insertions, 0 deletions