]> git.baikalelectronics.ru Git - kernel.git/commit
net/packet: tpacket_rcv: do not increment ring index on drop
authorWillem de Bruijn <willemb@google.com>
Mon, 9 Mar 2020 15:34:35 +0000 (11:34 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Mar 2020 06:12:16 +0000 (23:12 -0700)
commitfab34f2cc1ea9a8f01a5a8ac0bf724355ecd55d4
tree76c4e9db0d24d3027cff0ecfc537d0e8ab373d74
parent47f80376bdc8ff0beac72e29239dfd73dbbfdddc
net/packet: tpacket_rcv: do not increment ring index on drop

In one error case, tpacket_rcv drops packets after incrementing the
ring producer index.

If this happens, it does not update tp_status to TP_STATUS_USER and
thus the reader is stalled for an iteration of the ring, causing out
of order arrival.

The only such error path is when virtio_net_hdr_from_skb fails due
to encountering an unknown GSO type.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c