af_unix: take receive queue lock while appending new skb
[linux-2.6-block.git] / net / unix / af_unix.c
index a8352db5c5b54ca9d083a16400f41da5dd4ad871..955ec152cb71eac8c91e06f1c922d1df20f6e1f0 100644 (file)
@@ -1813,8 +1813,11 @@ alloc_skb:
        skb->truesize += size;
        atomic_add(size, &sk->sk_wmem_alloc);
 
-       if (newskb)
+       if (newskb) {
+               spin_lock(&other->sk_receive_queue.lock);
                __skb_queue_tail(&other->sk_receive_queue, newskb);
+               spin_unlock(&other->sk_receive_queue.lock);
+       }
 
        unix_state_unlock(other);
        mutex_unlock(&unix_sk(other)->readlock);