Re: [PATCH net] ovpn: hold peer before scheduling keepalive work
From: Antonio Quartulli
Date: Thu May 28 2026 - 10:36:49 EST
On Sat, 23 May 2026 20:38:27 +0545, Shuvam Pandey wrote:
> ovpn_peer_keepalive_send() passes its peer reference to
> ovpn_xmit_special(), which ultimately drops it. The keepalive scheduler
> currently queues the work first and takes the reference only after
> schedule_work() reports that the work was queued.
>
> Once schedule_work() queues the item, another CPU may run the worker
> before the caller gets to ovpn_peer_hold(). In that case the worker can
> consume a reference that was not acquired for it, corrupting the peer
> lifetime accounting.
>
> [...]
Applied, thanks!
[1/1] ovpn: hold peer before scheduling keepalive work
commit: c0951d651254b7d7f9a15d3ef149e8d2c9ff6ab6
Best regards,
--
Antonio Quartulli <antonio@xxxxxxxxxxx>