linux/drivers/net/ovpn
Ralf Lici 2da3dfa1dd ovpn: defer key slot crypto freeing to workqueue
Key slots are released through a kref and the existing release path
frees the AEAD transforms from an RCU callback. That is not safe for all
crypto implementations: crypto_free_aead can sleep, for example when an
async or hardware implementation has teardown work to complete.

Use queue_rcu_work for key-slot release. This keeps the RCU grace period
needed by lockless key-slot readers, but runs the actual crypto teardown
from workqueue context where sleeping is allowed. Once the rcu_work
callback runs, pre-existing RCU readers are gone, and the final kref put
already proves that no transform user remains, so the worker can release
the AEAD transforms and free the slot directly.

The previous patch drains ovpn_wq during module exit, so queued key-slot
teardown work cannot outlive module text.

Fixes: 8534731dbf ("ovpn: implement packet processing")
Signed-off-by: Ralf Lici <ralf@mandelbit.com>
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2026-08-09 22:47:57 +02:00
..
bind.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
bind.h ovpn: introduce the ovpn_peer object 2025-04-17 12:30:02 +02:00
crypto_aead.c ovpn: defer key slot crypto freeing to workqueue 2026-08-09 22:47:57 +02:00
crypto_aead.h ovpn: defer key slot crypto freeing to workqueue 2026-08-09 22:47:57 +02:00
crypto.c ovpn: defer key slot crypto freeing to workqueue 2026-08-09 22:47:57 +02:00
crypto.h ovpn: defer key slot crypto freeing to workqueue 2026-08-09 22:47:57 +02:00
io.c ovpn: finish crypto callback cleanup before peer release 2026-08-07 02:12:13 +02:00
io.h ovpn: implement keepalive mechanism 2025-04-17 12:30:03 +02:00
main.c ovpn: run deferred work on a module-owned workqueue 2026-08-09 22:47:57 +02:00
main.h
Makefile ovpn: implement TCP transport 2025-04-17 12:30:03 +02:00
netlink-gen.c ovpn: limit keepalive values to one day 2026-07-30 11:28:30 +02:00
netlink-gen.h ovpn: add support for asymmetric peer IDs 2026-03-17 11:09:05 +01:00
netlink.c ovpn: rehash peer in by_transp_addr table on CMD_PEER_SET 2026-07-30 11:28:30 +02:00
netlink.h ovpn: notify userspace on client float event 2026-03-17 11:08:55 +01:00
ovpnpriv.h ovpn: run deferred work on a module-owned workqueue 2026-08-09 22:47:57 +02:00
peer.c ovpn: run deferred work on a module-owned workqueue 2026-08-09 22:47:57 +02:00
peer.h ovpn: rehash peer in by_transp_addr table on CMD_PEER_SET 2026-07-30 11:28:30 +02:00
pktid.c ovpn: pktid: use bitops.h API 2026-03-17 11:08:54 +01:00
pktid.h ovpn: pktid: use bitops.h API 2026-03-17 11:08:54 +01:00
proto.h ovpn: implement packet processing 2025-04-17 12:30:02 +02:00
skb.h ovpn: consolidate crypto allocations in one chunk 2026-03-17 11:09:20 +01:00
socket.c ovpn: ensure socket is owned by ovpn before deref sk_user_data 2026-07-30 11:28:30 +02:00
socket.h ovpn: ensure sk is still valid during cleanup 2025-06-03 13:08:15 +02:00
stats.c ovpn: store tunnel and transport statistics 2025-04-17 12:30:02 +02:00
stats.h ovpn: disable BHs when updating device stats 2026-05-15 00:43:55 +02:00
tcp.c ovpn: run deferred work on a module-owned workqueue 2026-08-09 22:47:57 +02:00
tcp.h ovpn: ensure sk is still valid during cleanup 2025-06-03 13:08:15 +02:00
udp.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-05-21 15:09:02 -07:00
udp.h ovpn: ensure sk is still valid during cleanup 2025-06-03 13:08:15 +02:00