From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [RFC PATCH] kcm: hold rx mux lock when updating the receive queue. Date: Tue, 05 Jun 2018 10:53:35 -0400 (EDT) Message-ID: <20180605.105335.458709382920337752.davem@davemloft.net> References: Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, tom@quantonium.net, ktkhai@virtuozzo.com To: pabeni@redhat.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:37232 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752037AbeFEOxh (ORCPT ); Tue, 5 Jun 2018 10:53:37 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: From: Paolo Abeni Date: Tue, 5 Jun 2018 12:32:33 +0200 > @@ -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.