]> git.baikalelectronics.ru Git - kernel.git/commit
virtio_net: Fix out of bounds access of sq
authorToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Tue, 29 Jan 2019 00:45:56 +0000 (09:45 +0900)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Jan 2019 22:02:43 +0000 (14:02 -0800)
commitdaaa9b7703250ad0057d3a6a3f91fd6fecc0a5ba
tree504149649d26e614873add9ec91d156c0b20a5b5
parent400b64802605afa0b41a93a7d818cd80c2197b49
virtio_net: Fix out of bounds access of sq

When XDP is disabled, curr_queue_pairs + smp_processor_id() can be
larger than max_queue_pairs.
There is no guarantee that we have enough XDP send queues dedicated for
each cpu when XDP is disabled, so do not count drops on sq in that case.

Fixes: da40d73263cd ("virtio_net: Add XDP related stats")
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Acked-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c