Re: [PATCH net-next v5 10/25] ovpn: implement basic TX path (UDP)
From: Antonio Quartulli <antonio@openvpn.net>
Date: 2024-07-18 10:14:11
From: Antonio Quartulli <antonio@openvpn.net>
Date: 2024-07-18 10:14:11
On 18/07/2024 12:07, Sabrina Dubroca wrote:
2024-06-27, 15:08:28 +0200, Antonio Quartulli wrote:quoted
+static bool ovpn_encrypt_one(struct ovpn_peer *peer, struct sk_buff *skb) +{ + ovpn_skb_cb(skb)->peer = peer; + + /* take a reference to the peer because the crypto code may run async. + * ovpn_encrypt_post() will release it upon completion + */ + DEBUG_NET_WARN_ON_ONCE(!ovpn_peer_hold(peer));Shouldn't we abort if this fails? This should not really happen, but if it did, we would proceed (possibly with async crypto) without a ref on the peer.
Yap, better bail out.
quoted
+ ovpn_encrypt_post(skb, 0); + return true; +} +[...]quoted
diff --git a/drivers/net/ovpn/io.h b/drivers/net/ovpn/io.h index aa259be66441..95568671d5ae 100644 --- a/drivers/net/ovpn/io.h +++ b/drivers/net/ovpn/io.h@@ -12,4 +12,6 @@ netdev_tx_t ovpn_net_xmit(struct sk_buff *skb, struct net_device *dev); +void ovpn_encrypt_work(struct work_struct *work);leftover from the old implementation I think?
ops, you're right. Thanks
-- Antonio Quartulli OpenVPN Inc.