diff options
author | Yunsheng Lin <linyunsheng@huawei.com> | 2020-09-08 19:02:34 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-09-10 12:38:26 -0700 |
commit | 2fb541c862c987d02dfdf28f1545016deecfa0d5 (patch) | |
tree | 68e49da296f724a5cc66e17a6f561e26472c8109 /lib/dim | |
parent | edecfa98f602a597666e3c5cab2677ada38d93c5 (diff) | |
download | linux-2fb541c862c987d02dfdf28f1545016deecfa0d5.tar.bz2 |
net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc
Currently there is concurrent reset and enqueue operation for the
same lockless qdisc when there is no lock to synchronize the
q->enqueue() in __dev_xmit_skb() with the qdisc reset operation in
qdisc_deactivate() called by dev_deactivate_queue(), which may cause
out-of-bounds access for priv->ring[] in hns3 driver if user has
requested a smaller queue num when __dev_xmit_skb() still enqueue a
skb with a larger queue_mapping after the corresponding qdisc is
reset, and call hns3_nic_net_xmit() with that skb later.
Reused the existing synchronize_net() in dev_deactivate_many() to
make sure skb with larger queue_mapping enqueued to old qdisc(which
is saved in dev_queue->qdisc_sleeping) will always be reset when
dev_reset_queue() is called.
Fixes: 6b3ba9146fe6 ("net: sched: allow qdiscs to handle locking")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/dim')
0 files changed, 0 insertions, 0 deletions