Commit de4d768a authored by Michael S. Tsirkin's avatar Michael S. Tsirkin

vhost-net: remove unlocked use of receive_queue

Use of skb_queue_empty(&sock->sk->sk_receive_queue)
without taking the sk_receive_queue.lock is unsafe
or useless. Take it out.
Reported-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 783e3988
...@@ -311,7 +311,7 @@ static void handle_rx(struct vhost_net *net) ...@@ -311,7 +311,7 @@ static void handle_rx(struct vhost_net *net)
/* TODO: check that we are running from vhost_worker? */ /* TODO: check that we are running from vhost_worker? */
struct socket *sock = rcu_dereference_check(vq->private_data, 1); struct socket *sock = rcu_dereference_check(vq->private_data, 1);
if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) if (!sock)
return; return;
mutex_lock(&vq->mutex); mutex_lock(&vq->mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment