Thread (2 messages) flat view 2 messages, 2 authors, 2018-06-05

Re: [RFC PATCH] kcm: hold rx mux lock when updating the receive queue.

From: David Miller <davem@davemloft.net>
Date: 2018-06-05 14:53:37

From: Paolo Abeni <pabeni@redhat.com>
Date: Tue,  5 Jun 2018 12:32:33 +0200
quoted hunk ↗ jump to hunk
@@ -1157,7 +1158,9 @@ static int kcm_recvmsg(struct socket *sock, struct msghdr *msg,
 			/* Finished with message */
 			msg->msg_flags |= MSG_EOR;
 			KCM_STATS_INCR(kcm->stats.rx_msgs);
+			spin_lock_bh(&kcm->mux->rx_lock);
 			skb_unlink(skb, &sk->sk_receive_queue);
+			spin_unlock_bh(&kcm->mux->rx_lock);
Hmmm, maybe I don't understand the corruption.

But, skb_unlink() takes the sk->sk_receive_queue.lock which should
prevent SKB list corruption.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help