Thread (71 messages) flat view 71 messages, 3 authors, 2025-02-07

Re: [PATCH net-next v18 05/25] ovpn: introduce the ovpn_peer object

From: Sabrina Dubroca <sd@queasysnail.net>
Date: 2025-02-02 22:57:02
Also in: linux-kselftest, lkml

2025-01-13, 10:31:24 +0100, Antonio Quartulli wrote:
+static int ovpn_peer_del_p2p(struct ovpn_peer *peer,
+			     enum ovpn_del_peer_reason reason)
+{
+	struct ovpn_peer *tmp;
+
+	lockdep_assert_held(&peer->ovpn->lock);
+
+	tmp = rcu_dereference_protected(peer->ovpn->peer,
+					lockdep_is_held(&peer->ovpn->lock));
+	if (tmp != peer) {
+		DEBUG_NET_WARN_ON_ONCE(1);
I think this WARN should be removed. If 2 almost-simultanenous
DEL_PEER manage to fetch the peer, the first will delete it and NULL
peer->ovpn->peer, then when it releases ovpn->lock, the 2nd will find
NULL != peer and hit this WARN.

(probably not happening in practical cases, but syzbot will manage to
hit it)
+		return -ENOENT;
+	}
+
+	ovpn_peer_remove(peer, reason);
+
+	return 0;
+}
-- 
Sabrina
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help