Skip to content

Commit

Permalink
vhost-net: remove unlocked use of receive_queue
Browse files Browse the repository at this point in the history
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:  Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
Michael S. Tsirkin committed Mar 13, 2011
1 parent 783e398 commit de4d768
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/vhost/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ static void handle_rx(struct vhost_net *net)
/* TODO: check that we are running from vhost_worker? */
struct socket *sock = rcu_dereference_check(vq->private_data, 1);

if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue))
if (!sock)
return;

mutex_lock(&vq->mutex);
Expand Down

0 comments on commit de4d768

Please sign in to comment.