diff options
author | Michael Chan <[email protected]> | 2021-10-25 05:05:28 -0400 |
---|---|---|
committer | David S. Miller <[email protected]> | 2021-10-25 15:58:01 +0100 |
commit | 0c57eeecc559ca6bc18b8c4e2808bc78dbe769b0 (patch) | |
tree | d079961c19187a4aa0fa034c0082638a41fd852d /tools/testing/selftests/bpf/prog_tests/prog_array_init.c | |
parent | ace19b992436a257d9a793672e57abc28fe83e2e (diff) |
net: Prevent infinite while loop in skb_tx_hash()
Drivers call netdev_set_num_tc() and then netdev_set_tc_queue()
to set the queue count and offset for each TC. So the queue count
and offset for the TCs may be zero for a short period after dev->num_tc
has been set. If a TX packet is being transmitted at this time in the
code path netdev_pick_tx() -> skb_tx_hash(), skb_tx_hash() may see
nonzero dev->num_tc but zero qcount for the TC. The while loop that
keeps looping while hash >= qcount will not end.
Fix it by checking the TC's qcount to be nonzero before using it.
Fixes: eadec877ce9c ("net: Add support for subordinate traffic classes to netdev_pick_tx")
Reviewed-by: Andy Gospodarek <[email protected]>
Signed-off-by: Michael Chan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/prog_array_init.c')
0 files changed, 0 insertions, 0 deletions