Subject: Re: [PATCH net-next v5 10/25] ovpn: implement basic TX path (UDP)

From: Sabrina Dubroca <[email-masked]>
Date: Thu, 18 Jul 2024 12:07:39 +0200

2024-06-27, 15:08:28 +0200, Antonio Quartulli wrote:
> +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.

> +	ovpn_encrypt_post(skb, 0);
> +	return true;
> +}
> +

[...]
> 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?

-- 
Sabrina