linux/drivers/net/ovpn
Marco Baffo f7e6287ccd ovpn: use monotonic clock for peer keepalive timeouts
Replace ktime_get_real_seconds() with the monotonic
ktime_get_boottime_seconds() to ensure the keepalive mechanism is robust
against system clock modifications.

Right now, the driver uses ktime_get_real_seconds() to track peer
timeouts, relying on the system wall-clock.

An administrative time adjustment or an NTP sync that steps the clock
forward can cause `now' to instantly exceed `last_recv + timeout'.

When this occurs, the driver artificially expires healthy peers.
Depending on the OpenVPN user-space configuration, this triggers a
premature tunnel restart (if --keepalive or --ping-restart is used) or
a complete disconnection of the client (if --ping-exit is used).

Fixes: 3ecfd9349f ("ovpn: implement keepalive mechanism")
Signed-off-by: Marco Baffo <marco@mandelbit.com>
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2026-07-20 16:29:31 +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: consolidate crypto allocations in one chunk 2026-03-17 11:09:20 +01:00
crypto_aead.h ovpn: implement key add/get/del/swap via netlink 2025-04-17 12:30:03 +02:00
crypto.c ovpn: kill key and notify userspace in case of IV exhaustion 2025-04-17 12:30:03 +02:00
crypto.h ovpn: kill key and notify userspace in case of IV exhaustion 2025-04-17 12:30:03 +02:00
io.c ovpn: use monotonic clock for peer keepalive timeouts 2026-07-20 16:29:31 +02:00
io.h ovpn: implement keepalive mechanism 2025-04-17 12:30:03 +02:00
main.c ovpn: fix race between deleting interface and adding new peer 2026-05-14 16:24:45 +02:00
main.h
Makefile ovpn: implement TCP transport 2025-04-17 12:30:03 +02:00
netlink-gen.c ovpn: add support for asymmetric peer IDs 2026-03-17 11:09:05 +01:00
netlink-gen.h ovpn: add support for asymmetric peer IDs 2026-03-17 11:09:05 +01:00
netlink.c ovpn: respect peer refcount in CMD_NEW_PEER error path 2026-05-14 16:24:45 +02:00
netlink.h ovpn: notify userspace on client float event 2026-03-17 11:08:55 +01:00
ovpnpriv.h ovpn: implement keepalive mechanism 2025-04-17 12:30:03 +02:00
peer.c ovpn: use monotonic clock for peer keepalive timeouts 2026-07-20 16:29:31 +02:00
peer.h ovpn: respect peer refcount in CMD_NEW_PEER error path 2026-05-14 16:24:45 +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 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08: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: fix peer refcount leak in TCP error paths 2026-07-20 15:49:55 +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