[PATCH net-next v19 21/26] ovpn: implement key add/get/del/swap via netlink

2025-02-10 Thread Antonio Quartulli
This change introduces the netlink commands needed to add, get, delete and swap keys for a specific peer. Userspace is expected to use these commands to create, inspect (non sensitive data only), destroy and rotate session keys for a specific peer. Signed-off-by: Antonio Quartulli --- drivers

Re: [PATCH net-next v18 05/25] ovpn: introduce the ovpn_peer object

2025-02-03 Thread Antonio Quartulli
On 02/02/2025 23:56, Sabrina Dubroca wrote: 2025-01-13, 10:31:24 +0100, Antonio Quartulli wrote: +static int ovpn_peer_del_p2p(struct ovpn_peer *peer, +enum ovpn_del_peer_reason reason) +{ + struct ovpn_peer *tmp; + + lockdep_assert_held(&peer->ovp

[PATCH net-next v15 01/22] net: introduce OpenVPN Data Channel Offload (ovpn)

2024-12-11 Thread Antonio Quartulli
ff-by: Antonio Quartulli --- MAINTAINERS | 8 drivers/net/Kconfig | 7 +++ drivers/net/Makefile | 1 + drivers/net/ovpn/Makefile | 10 + drivers/net/ovpn/main.c | 112 ++ 5 files changed, 138 insertions(+) diff

[PATCH net-next v15 00/22] Introducing OpenVPN Data Channel Offload

2024-12-11 Thread Antonio Quartulli
since no major code modification has happened since the review. The latest code can also be found at: https://github.com/OpenVPN/linux-kernel-ovpn Thanks a lot! Best Regards, Antonio Quartulli OpenVPN Inc. --- Antonio Quartulli (22): net: introduce OpenVPN Data Channel Offload (ovpn

[PATCH net-next v15 02/22] ovpn: add basic netlink support

2024-12-11 Thread Antonio Quartulli
/ovpn/netlink-gen.h Cc: donald.hun...@gmail.com Signed-off-by: Antonio Quartulli --- Documentation/netlink/specs/ovpn.yaml | 372 ++ MAINTAINERS | 2 + drivers/net/ovpn/Makefile | 2 + drivers/net/ovpn/main.c

[PATCH net-next v15 05/22] ovpn: introduce the ovpn_peer object

2024-12-11 Thread Antonio Quartulli
ovpn_peer, also the ovpn_bind object is introcued as the two are strictly related. An ovpn_bind object wraps a sockaddr representing the local coordinates being used to talk to a specific peer. Signed-off-by: Antonio Quartulli --- drivers/net/Kconfig | 1 + drivers/net/ovpn/Makefile

[PATCH net-next v15 07/22] ovpn: implement basic TX path (UDP)

2024-12-11 Thread Antonio Quartulli
Packets sent over the ovpn interface are processed and transmitted to the connected peer, if any. Implementation is UDP only. TCP will be added by a later patch. Note: no crypto/encapsulation exists yet. Packets are just captured and sent. Signed-off-by: Antonio Quartulli --- drivers/net

[PATCH net-next v15 08/22] ovpn: implement basic RX path (UDP)

2024-12-11 Thread Antonio Quartulli
Packets received over the socket are forwarded to the user device. Implementation is UDP only. TCP will be added by a later patch. Note: no decryption/decapsulation exists yet, packets are forwarded as they arrive without much processing. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn

[PATCH net-next v15 06/22] ovpn: introduce the ovpn_socket object

2024-12-11 Thread Antonio Quartulli
a later patch. Cc: willemdebruijn.ker...@gmail.com Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/Makefile | 2 + drivers/net/ovpn/socket.c | 119 ++ drivers/net/ovpn/socket.h | 48 +++ drivers/net/ovpn/udp.c| 65

[PATCH net-next v15 03/22] ovpn: add basic interface creation/destruction/management routines

2024-12-11 Thread Antonio Quartulli
Add basic infrastructure for handling ovpn interfaces. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/Makefile | 1 + drivers/net/ovpn/io.c | 22 + drivers/net/ovpn/io.h | 24 ++ drivers/net/ovpn/main.c | 102

[PATCH net-next v15 04/22] ovpn: keep carrier always on for MP interfaces

2024-12-11 Thread Antonio Quartulli
An ovpn interface configured in MP mode will keep carrier always on and let the user decide when to bring it administratively up and down. This way a MP node (i.e. a server) will keep its interface always up and running, even when no peer is connected. Signed-off-by: Antonio Quartulli

[PATCH net-next v15 09/22] ovpn: implement packet processing

2024-12-11 Thread Antonio Quartulli
This change implements encryption/decryption and encapsulation/decapsulation of OpenVPN packets. Support for generic crypto state is added along with a wrapper for the AEAD crypto kernel API. Signed-off-by: Antonio Quartulli --- drivers/net/Kconfig| 4 + drivers/net/ovpn/Makefile

[PATCH net-next v15 10/22] ovpn: store tunnel and transport statistics

2024-12-11 Thread Antonio Quartulli
Byte/packet counters for in-tunnel and transport streams are now initialized and updated as needed. To be exported via netlink. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/Makefile | 1 + drivers/net/ovpn/io.c | 12 +++- drivers/net/ovpn/peer.c | 2 ++ drivers/net

[PATCH net-next v15 11/22] ovpn: implement TCP transport

2024-12-11 Thread Antonio Quartulli
ess inet6_stream_ops, which is declared as extern in the IPv6 module, but it is not fully exported. Therefore this patch is also adding EXPORT_SYMBOL_GPL(inet6_stream_ops) to net/ipv6/af_inet6.c. Cc: dsah...@kernel.org Signed-off-by: Antonio Quartulli --- drivers/net/Kconfig | 1 + drivers/net/o

[PATCH net-next v15 13/22] ovpn: implement peer lookup logic

2024-12-11 Thread Antonio Quartulli
: Antonio Quartulli --- drivers/net/ovpn/peer.c | 301 ++-- 1 file changed, 291 insertions(+), 10 deletions(-) diff --git a/drivers/net/ovpn/peer.c b/drivers/net/ovpn/peer.c index 9f213ccacfaf8170b9c23730498f156360774d7e

[PATCH net-next v15 12/22] ovpn: implement multi-peer support

2024-12-11 Thread Antonio Quartulli
With this change an ovpn instance will be able to stay connected to multiple remote endpoints. This functionality is strictly required when running ovpn on an OpenVPN server. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/main.c | 67 - drivers/net/ovpn

[PATCH net-next v15 17/22] ovpn: implement peer add/get/dump/delete via netlink

2024-12-11 Thread Antonio Quartulli
This change introduces the netlink command needed to add, delete and retrieve/dump known peers. Userspace is expected to use these commands to handle known peer lifecycles. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/netlink.c | 640

[PATCH net-next v15 14/22] ovpn: implement keepalive mechanism

2024-12-11 Thread Antonio Quartulli
OpenVPN supports configuring a periodic keepalive packet. message to allow the remote endpoint detect link failures. This change implements the keepalive sending and timer expiring logic. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/io.c | 77 + drivers/net

[PATCH net-next v15 16/22] ovpn: add support for peer floating

2024-12-11 Thread Antonio Quartulli
A peer connected via UDP may change its IP address without reconnecting (float). Add support for detecting and updating the new peer IP/port in case of floating. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/bind.c | 9 +- drivers/net/ovpn/io.c | 4 + drivers/net/ovpn/peer.c

[PATCH net-next v15 18/22] ovpn: implement key add/get/del/swap via netlink

2024-12-11 Thread Antonio Quartulli
This change introduces the netlink commands needed to add, get, delete and swap keys for a specific peer. Userspace is expected to use these commands to create, inspect (non sensitive data only), destroy and rotate session keys for a specific peer. Signed-off-by: Antonio Quartulli --- drivers

[PATCH net-next v15 19/22] ovpn: kill key and notify userspace in case of IV exhaustion

2024-12-11 Thread Antonio Quartulli
amount of traffic by periodically polling GET_PEER and fetching the VPN/LINK stats. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/crypto.c | 19 drivers/net/ovpn/crypto.h | 2 ++ drivers/net/ovpn/io.c | 13 +++ drivers/net/ovpn/netlink.c | 55

[PATCH net-next v15 20/22] ovpn: notify userspace when a peer is deleted

2024-12-11 Thread Antonio Quartulli
Whenever a peer is deleted, send a notification to userspace so that it can react accordingly. This is most important when a peer is deleted due to ping timeout, because it all happens in kernelspace and thus userspace has no direct way to learn about it. Signed-off-by: Antonio Quartulli

[PATCH net-next v15 22/22] testing/selftests: add test tool and scripts for ovpn module

2024-12-11 Thread Antonio Quartulli
`ping`, `iperf` and `ovpn-cli` itself. In general it is useful only in case of failure, in order to understand which step has failed and why. Cc: linux-kselft...@vger.kernel.org Signed-off-by: Antonio Quartulli Reviewed-by: Shuah Khan --- MAINTAINERS|1

[PATCH net-next v15 21/22] ovpn: add basic ethtool support

2024-12-11 Thread Antonio Quartulli
Implement support for basic ethtool functionality. Note that ovpn is a virtual device driver, therefore various ethtool APIs are just not meaningful and thus not implemented. Signed-off-by: Antonio Quartulli Reviewed-by: Andrew Lunn --- drivers/net/ovpn/main.c | 15 +++ 1 file

[PATCH net-next v15 15/22] ovpn: add support for updating local UDP endpoint

2024-12-11 Thread Antonio Quartulli
In case of UDP links, the local endpoint used to communicate with a given peer may change without a connection restart. Add support for learning the new address in case of change. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/peer.c | 45

Re: [PATCH net-next v14 17/22] ovpn: implement peer add/get/dump/delete via netlink

2024-12-11 Thread Antonio Quartulli
Hi Xiao and thanks for chiming in, On 11/12/2024 04:08, Xiao Liang wrote: On Mon, Dec 9, 2024 at 6:48 PM Antonio Quartulli wrote: [...] +/** + * ovpn_nl_peer_modify - modify the peer attributes according to the incoming msg + * @peer: the peer to modify + * @info: generic netlink info from

Re: [PATCH net-next v14 17/22] ovpn: implement peer add/get/dump/delete via netlink

2024-12-11 Thread Antonio Quartulli
On 11/12/2024 13:35, Xiao Liang wrote: On Wed, Dec 11, 2024 at 7:30 PM Antonio Quartulli wrote: Hi Xiao and thanks for chiming in, On 11/12/2024 04:08, Xiao Liang wrote: On Mon, Dec 9, 2024 at 6:48 PM Antonio Quartulli wrote: [...] +/** + * ovpn_nl_peer_modify - modify the peer attributes

Re: [PATCH net-next v14 17/22] ovpn: implement peer add/get/dump/delete via netlink

2024-12-11 Thread Antonio Quartulli
On 11/12/2024 14:53, Xiao Liang wrote: On Wed, Dec 11, 2024 at 8:51 PM Antonio Quartulli wrote: On 11/12/2024 13:35, Xiao Liang wrote: On Wed, Dec 11, 2024 at 7:30 PM Antonio Quartulli wrote: Hi Xiao and thanks for chiming in, On 11/12/2024 04:08, Xiao Liang wrote: On Mon, Dec 9, 2024

Re: [PATCH net-next v14 08/22] ovpn: implement basic RX path (UDP)

2024-12-11 Thread Antonio Quartulli
On 10/12/2024 17:44, Simon Horman wrote: On Mon, Dec 09, 2024 at 09:53:17AM +0100, Antonio Quartulli wrote: Packets received over the socket are forwarded to the user device. Implementation is UDP only. TCP will be added by a later patch. Note: no decryption/decapsulation exists yet, packets

Re: [PATCH net-next v14 22/22] testing/selftests: add test tool and scripts for ovpn module

2024-12-11 Thread Antonio Quartulli
On 10/12/2024 17:47, Simon Horman wrote: On Mon, Dec 09, 2024 at 09:53:31AM +0100, Antonio Quartulli wrote: The ovpn-cli tool can be compiled and used as selftest for the ovpn kernel module. [NOTE: it depends on libmedtls for decoding base64-encoded keys] ovpn-cli implements the netlink and

Re: [PATCH net-next v15 11/22] ovpn: implement TCP transport

2024-12-16 Thread Antonio Quartulli
On 16/12/2024 14:59, Sabrina Dubroca wrote: 2024-12-11, 22:15:15 +0100, Antonio Quartulli wrote: @@ -42,6 +56,31 @@ struct ovpn_peer { struct in6_addr ipv6; } vpn_addrs; struct ovpn_socket *sock; + + /* state of the TCP reading. Needed to keep track of how

Re: [PATCH net-next v15 06/22] ovpn: introduce the ovpn_socket object

2024-12-16 Thread Antonio Quartulli
attaching part, it may be worth throwing in those typ0 fixes too :) ACK, I'll send them out. Thanks. Regards, -- Antonio Quartulli OpenVPN Inc.

Re: [PATCH net-next v15 06/22] ovpn: introduce the ovpn_socket object

2024-12-16 Thread Antonio Quartulli
On 16/12/2024 12:50, Antonio Quartulli wrote: On 16/12/2024 12:09, Sabrina Dubroca wrote: [...] Maybe we should call cancel_sync_work(&ovpn_sock->work) inside ovpn_socket_get()? So the latter will return NULL only when it is sure that the socket has been detached. At that point we c

[PATCH net-next v16 00/26] Introducing OpenVPN Data Channel Offload

2024-12-18 Thread Antonio Quartulli
d Hunter and Shuah Khan. They have retained the Reviewed-by tag since no major code modification has happened since the review. The latest code can also be found at: https://github.com/OpenVPN/linux-kernel-ovpn Thanks a lot! Best Regards, Antonio Quartulli OpenVPN Inc. --- Antonio Quartulli (26

[PATCH net-next v16 04/26] ovpn: keep carrier always on for MP interfaces

2024-12-18 Thread Antonio Quartulli
An ovpn interface configured in MP mode will keep carrier always on and let the user decide when to bring it administratively up and down. This way a MP node (i.e. a server) will keep its interface always up and running, even when no peer is connected. Signed-off-by: Antonio Quartulli

[PATCH net-next v16 03/26] ovpn: add basic interface creation/destruction/management routines

2024-12-18 Thread Antonio Quartulli
Add basic infrastructure for handling ovpn interfaces. Signed-off-by: Antonio Quartulli --- Documentation/netlink/specs/rt_link.yaml | 16 + drivers/net/ovpn/Makefile| 1 + drivers/net/ovpn/io.c| 22 ++ drivers/net/ovpn/io.h

[PATCH net-next v16 02/26] ovpn: add basic netlink support

2024-12-18 Thread Antonio Quartulli
/ovpn/netlink-gen.h Cc: donald.hun...@gmail.com Signed-off-by: Antonio Quartulli --- Documentation/netlink/specs/ovpn.yaml | 372 ++ MAINTAINERS | 2 + drivers/net/ovpn/Makefile | 2 + drivers/net/ovpn/main.c

[PATCH net-next v16 01/26] net: introduce OpenVPN Data Channel Offload (ovpn)

2024-12-18 Thread Antonio Quartulli
ff-by: Antonio Quartulli --- MAINTAINERS | 8 drivers/net/Kconfig | 8 drivers/net/Makefile | 1 + drivers/net/ovpn/Makefile | 10 + drivers/net/ovpn/main.c | 112 ++ 5 files changed, 139 insertions(+)

[PATCH net-next v16 05/26] ovpn: introduce the ovpn_peer object

2024-12-18 Thread Antonio Quartulli
ovpn_peer, also the ovpn_bind object is introcued as the two are strictly related. An ovpn_bind object wraps a sockaddr representing the local coordinates being used to talk to a specific peer. Signed-off-by: Antonio Quartulli --- drivers/net/Kconfig | 1 + drivers/net/ovpn/Makefile

[PATCH net-next v16 06/26] kref/refcount: implement kref_put_sock()

2024-12-18 Thread Antonio Quartulli
(maintainer:ATOMIC INFRASTRUCTURE) Cc: Boqun Feng (reviewer:ATOMIC INFRASTRUCTURE) Cc: Mark Rutland (reviewer:ATOMIC INFRASTRUCTURE) Cc: Andrew Morton Signed-off-by: Antonio Quartulli --- include/linux/kref.h | 11 +++ include/linux/refcount.h | 3 +++ lib/refcount.c | 32

[PATCH net-next v16 09/26] ovpn: implement basic RX path (UDP)

2024-12-18 Thread Antonio Quartulli
Packets received over the socket are forwarded to the user device. Implementation is UDP only. TCP will be added by a later patch. Note: no decryption/decapsulation exists yet, packets are forwarded as they arrive without much processing. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn

[PATCH net-next v16 07/26] ovpn: introduce the ovpn_socket object

2024-12-18 Thread Antonio Quartulli
a later patch. Cc: willemdebruijn.ker...@gmail.com Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/Makefile | 2 + drivers/net/ovpn/socket.c | 163 ++ drivers/net/ovpn/socket.h | 38 +++ drivers/net/ovpn/udp.c| 73

[PATCH net-next v16 18/26] ovpn: implement keepalive mechanism

2024-12-18 Thread Antonio Quartulli
OpenVPN supports configuring a periodic keepalive packet. message to allow the remote endpoint detect link failures. This change implements the keepalive sending and timer expiring logic. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/io.c | 77 + drivers/net

[PATCH net-next v16 16/26] ovpn: implement multi-peer support

2024-12-18 Thread Antonio Quartulli
With this change an ovpn instance will be able to stay connected to multiple remote endpoints. This functionality is strictly required when running ovpn on an OpenVPN server. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/main.c | 67 +- drivers/net/ovpn

[PATCH net-next v16 20/26] ovpn: add support for peer floating

2024-12-18 Thread Antonio Quartulli
A peer connected via UDP may change its IP address without reconnecting (float). Add support for detecting and updating the new peer IP/port in case of floating. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/io.c | 4 + drivers/net/ovpn/peer.c | 243

Re: [PATCH net-next v15 06/22] ovpn: introduce the ovpn_socket object

2024-12-12 Thread Antonio Quartulli
On 12/12/2024 17:19, Sabrina Dubroca wrote: 2024-12-11, 22:15:10 +0100, Antonio Quartulli wrote: +static struct ovpn_socket *ovpn_socket_get(struct socket *sock) +{ + struct ovpn_socket *ovpn_sock; + + rcu_read_lock(); + ovpn_sock = rcu_dereference_sk_user_data(sock->

Re: [PATCH net-next v15 03/22] ovpn: add basic interface creation/destruction/management routines

2024-12-13 Thread Antonio Quartulli
On 13/12/2024 13:32, Donald Hunter wrote: On Wed, 11 Dec 2024 at 21:32, Antonio Quartulli wrote: static int ovpn_newlink(struct net *src_net, struct net_device *dev, struct nlattr *tb[], struct nlattr *data[], struct netlink_ext_ack *extack

Re: [PATCH net-next v15 02/22] ovpn: add basic netlink support

2024-12-13 Thread Antonio Quartulli
On 13/12/2024 17:45, Donald Hunter wrote: On Wed, 11 Dec 2024 at 21:32, Antonio Quartulli wrote: +name: peer +type: nest +doc: | + The peer object containing the attributed of interest for the specific typo: attributes + operation +nested

[PATCH net-next v16 10/26] ovpn: implement packet processing

2024-12-18 Thread Antonio Quartulli
This change implements encryption/decryption and encapsulation/decapsulation of OpenVPN packets. Support for generic crypto state is added along with a wrapper for the AEAD crypto kernel API. Signed-off-by: Antonio Quartulli --- drivers/net/Kconfig| 4 + drivers/net/ovpn/Makefile

[PATCH net-next v16 17/26] ovpn: implement peer lookup logic

2024-12-18 Thread Antonio Quartulli
: Antonio Quartulli --- drivers/net/ovpn/peer.c | 301 ++-- 1 file changed, 291 insertions(+), 10 deletions(-) diff --git a/drivers/net/ovpn/peer.c b/drivers/net/ovpn/peer.c index 956104183f40c7c44f4fbbb8f2a4c48748d6b56f

[PATCH net-next v16 19/26] ovpn: add support for updating local UDP endpoint

2024-12-18 Thread Antonio Quartulli
In case of UDP links, the local endpoint used to communicate with a given peer may change without a connection restart. Add support for learning the new address in case of change. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/peer.c | 45

[PATCH net-next v16 26/26] testing/selftests: add test tool and scripts for ovpn module

2024-12-18 Thread Antonio Quartulli
`ping`, `iperf` and `ovpn-cli` itself. In general it is useful only in case of failure, in order to understand which step has failed and why. Cc: linux-kselft...@vger.kernel.org Signed-off-by: Antonio Quartulli Reviewed-by: Shuah Khan --- MAINTAINERS|1

[PATCH net-next v16 25/26] ovpn: add basic ethtool support

2024-12-18 Thread Antonio Quartulli
Implement support for basic ethtool functionality. Note that ovpn is a virtual device driver, therefore various ethtool APIs are just not meaningful and thus not implemented. Signed-off-by: Antonio Quartulli Reviewed-by: Andrew Lunn --- drivers/net/ovpn/main.c | 15 +++ 1 file

[PATCH net-next v16 08/26] ovpn: implement basic TX path (UDP)

2024-12-18 Thread Antonio Quartulli
Packets sent over the ovpn interface are processed and transmitted to the connected peer, if any. Implementation is UDP only. TCP will be added by a later patch. Note: no crypto/encapsulation exists yet. Packets are just captured and sent. Signed-off-by: Antonio Quartulli --- drivers/net

[PATCH net-next v16 12/26] ipv6: export inet6_stream_ops via EXPORT_SYMBOL_GPL

2024-12-18 Thread Antonio Quartulli
Kicinski Cc: Paolo Abeni Cc: Simon Horman Signed-off-by: Antonio Quartulli --- net/ipv6/af_inet6.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index f60ec8b0f8ea40b2d635d802a3bc4f9b9d844417..3e812187e125cec7deac88413b85a35dd5b22a2d 100644 --- a/net

[PATCH net-next v16 22/26] ovpn: implement key add/get/del/swap via netlink

2024-12-18 Thread Antonio Quartulli
This change introduces the netlink commands needed to add, get, delete and swap keys for a specific peer. Userspace is expected to use these commands to create, inspect (non sensitive data only), destroy and rotate session keys for a specific peer. Signed-off-by: Antonio Quartulli --- drivers

[PATCH net-next v16 21/26] ovpn: implement peer add/get/dump/delete via netlink

2024-12-18 Thread Antonio Quartulli
This change introduces the netlink command needed to add, delete and retrieve/dump known peers. Userspace is expected to use these commands to handle known peer lifecycles. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/netlink.c | 629

[PATCH net-next v16 23/26] ovpn: kill key and notify userspace in case of IV exhaustion

2024-12-18 Thread Antonio Quartulli
amount of traffic by periodically polling GET_PEER and fetching the VPN/LINK stats. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/crypto.c | 19 drivers/net/ovpn/crypto.h | 2 ++ drivers/net/ovpn/io.c | 13 +++ drivers/net/ovpn/netlink.c | 55

[PATCH net-next v16 24/26] ovpn: notify userspace when a peer is deleted

2024-12-18 Thread Antonio Quartulli
Whenever a peer is deleted, send a notification to userspace so that it can react accordingly. This is most important when a peer is deleted due to ping timeout, because it all happens in kernelspace and thus userspace has no direct way to learn about it. Signed-off-by: Antonio Quartulli

[PATCH net-next v16 13/26] ovpn: implement TCP transport

2024-12-18 Thread Antonio Quartulli
ess inet6_stream_ops, which is declared as extern in the IPv6 module, but it is not fully exported. Therefore this patch is also adding EXPORT_SYMBOL_GPL(inet6_stream_ops) to net/ipv6/af_inet6.c. Signed-off-by: Antonio Quartulli --- drivers/net/Kconfig | 1 + drivers/net/ovpn/Makefile |

[PATCH net-next v16 11/26] ovpn: store tunnel and transport statistics

2024-12-18 Thread Antonio Quartulli
Byte/packet counters for in-tunnel and transport streams are now initialized and updated as needed. To be exported via netlink. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/Makefile | 1 + drivers/net/ovpn/io.c | 12 +++- drivers/net/ovpn/peer.c | 2 ++ drivers/net

[PATCH net-next v16 14/26] skb: implement skb_send_sock_locked_with_flags()

2024-12-18 Thread Antonio Quartulli
and add a new interface named skb_send_sock_locked_with_flags(). Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Simon Horman Signed-off-by: Antonio Quartulli --- include/linux/skbuff.h | 2 ++ net/core/skbuff.c | 18 +- 2 files changed, 15 insertions(+), 5 delet

[PATCH net-next v16 15/26] ovpn: add support for MSG_NOSIGNAL in tcp_sendmsg

2024-12-18 Thread Antonio Quartulli
Userspace may want to pass the MSG_NOSIGNAL flag to tcp_sendmsg() in order to avoid generating a SIGPIPE. To pass this flag down the TCP stack a new skb sending API accepting a flags argument is introduced. Cc: Eric Dumazet Cc: Paolo Abeni Signed-off-by: Antonio Quartulli --- drivers/net

Re: [PATCH net-next v11 08/23] ovpn: implement basic TX path (UDP)

2024-11-21 Thread Antonio Quartulli
On 21/11/2024 01:29, Sergey Ryazanov wrote: On 15.11.2024 16:39, Antonio Quartulli wrote: On 11/11/2024 00:54, Sergey Ryazanov wrote: Another one forgotten question, sorry about this. Please find the question inlined. On 29.10.2024 12:47, Antonio Quartulli wrote:   /* Send user data to the

Re: [PATCH net-next v11 07/23] ovpn: introduce the ovpn_socket object

2024-11-21 Thread Antonio Quartulli
On 21/11/2024 00:34, Sergey Ryazanov wrote: On 19.11.2024 15:44, Antonio Quartulli wrote: On 15/11/2024 15:28, Antonio Quartulli wrote: [...] +} + +static struct ovpn_socket *ovpn_socket_get(struct socket *sock) +{ +    struct ovpn_socket *ovpn_sock; + +    rcu_read_lock(); +    ovpn_sock

Re: [PATCH net-next v11 06/23] ovpn: introduce the ovpn_peer object

2024-11-21 Thread Antonio Quartulli
On 21/11/2024 00:22, Sergey Ryazanov wrote: On 13.11.2024 12:03, Sabrina Dubroca wrote: 2024-11-13, 03:37:13 +0200, Sergey Ryazanov wrote: On 12.11.2024 19:31, Sabrina Dubroca wrote: 2024-11-10, 15:38:27 +0200, Sergey Ryazanov wrote: On 29.10.2024 12:47, Antonio Quartulli wrote: An

Re: [PATCH net-next v11 08/23] ovpn: implement basic TX path (UDP)

2024-11-21 Thread Antonio Quartulli
On 20/11/2024 12:45, Sabrina Dubroca wrote: 2024-10-29, 11:47:21 +0100, Antonio Quartulli wrote: +static int ovpn_udp4_output(struct ovpn_struct *ovpn, struct ovpn_bind *bind, + struct dst_cache *cache, struct sock *sk, + struct sk_buff *skb

Re: [PATCH net-next v11 18/23] ovpn: implement peer add/get/dump/delete via netlink

2024-11-21 Thread Antonio Quartulli
On 21/11/2024 17:02, Sabrina Dubroca wrote: [I'm still thinking about the locking problems for ovpn_peer_float, but just noticed this while staring at the rehash code] 2024-10-29, 11:47:31 +0100, Antonio Quartulli wrote: +void ovpn_peer_hash_vpn_ip(struct ovpn_peer *peer) + __must

Re: [PATCH net-next v11 06/23] ovpn: introduce the ovpn_peer object

2024-11-21 Thread Antonio Quartulli
On 20/11/2024 12:56, Sabrina Dubroca wrote: 2024-10-29, 11:47:19 +0100, Antonio Quartulli wrote: +/** + * struct ovpn_peer - the main remote peer object + * @ovpn: main openvpn instance this peer belongs to + * @id: unique identifier + * @vpn_addrs: IP addresses assigned over the tunnel

Re: [PATCH net-next v11 07/23] ovpn: introduce the ovpn_socket object

2024-11-21 Thread Antonio Quartulli
On 21/11/2024 00:58, Sergey Ryazanov wrote: On 15.11.2024 16:28, Antonio Quartulli wrote: On 10/11/2024 19:26, Sergey Ryazanov wrote: On 29.10.2024 12:47, Antonio Quartulli wrote: [...] +static bool ovpn_socket_hold(struct ovpn_socket *sock) +{ +    return kref_get_unless_zero(&

Re: [PATCH net-next v11 05/23] ovpn: keep carrier always on

2024-11-21 Thread Antonio Quartulli
On 20/11/2024 23:56, Sergey Ryazanov wrote: On 15.11.2024 16:13, Antonio Quartulli wrote: On 09/11/2024 02:11, Sergey Ryazanov wrote: On 29.10.2024 12:47, Antonio Quartulli wrote: An ovpn interface will keep carrier always on and let the user decide when an interface should be considered

[PATCH net-next v13 04/22] ovpn: keep carrier always on for MP interfaces

2024-12-06 Thread Antonio Quartulli
An ovpn interface configured in MP mode will keep carrier always on and let the user decide when to bring it administratively up and down. This way a MP node (i.e. a server) will keep its interface always up and running, even when no peer is connected. Signed-off-by: Antonio Quartulli

[PATCH net-next v13 09/22] ovpn: implement packet processing

2024-12-06 Thread Antonio Quartulli
This change implements encryption/decryption and encapsulation/decapsulation of OpenVPN packets. Support for generic crypto state is added along with a wrapper for the AEAD crypto kernel API. Signed-off-by: Antonio Quartulli --- drivers/net/Kconfig| 4 + drivers/net/ovpn/Makefile

[PATCH net-next v13 05/22] ovpn: introduce the ovpn_peer object

2024-12-06 Thread Antonio Quartulli
ovpn_peer, also the ovpn_bind object is introcued as the two are strictly related. An ovpn_bind object wraps a sockaddr representing the local coordinates being used to talk to a specific peer. Signed-off-by: Antonio Quartulli --- drivers/net/Kconfig | 1 + drivers/net/ovpn/Makefile

[PATCH net-next v13 08/22] ovpn: implement basic RX path (UDP)

2024-12-06 Thread Antonio Quartulli
Packets received over the socket are forwarded to the user device. Implementation is UDP only. TCP will be added by a later patch. Note: no decryption/decapsulation exists yet, packets are forwarded as they arrive without much processing. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn

[PATCH net-next v13 06/22] ovpn: introduce the ovpn_socket object

2024-12-06 Thread Antonio Quartulli
a later patch. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/Makefile | 2 + drivers/net/ovpn/socket.c | 119 ++ drivers/net/ovpn/socket.h | 48 +++ drivers/net/ovpn/udp.c| 65 + drivers/net/ovpn

[PATCH net-next v13 12/22] ovpn: implement multi-peer support

2024-12-06 Thread Antonio Quartulli
With this change an ovpn instance will be able to stay connected to multiple remote endpoints. This functionality is strictly required when running ovpn on an OpenVPN server. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/main.c | 67 - drivers/net/ovpn

[PATCH net-next v13 13/22] ovpn: implement peer lookup logic

2024-12-06 Thread Antonio Quartulli
: Antonio Quartulli --- drivers/net/ovpn/peer.c | 301 ++-- 1 file changed, 291 insertions(+), 10 deletions(-) diff --git a/drivers/net/ovpn/peer.c b/drivers/net/ovpn/peer.c index 9f213ccacfaf8170b9c23730498f156360774d7e

[PATCH net-next v13 10/22] ovpn: store tunnel and transport statistics

2024-12-06 Thread Antonio Quartulli
Byte/packet counters for in-tunnel and transport streams are now initialized and updated as needed. To be exported via netlink. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/Makefile | 1 + drivers/net/ovpn/io.c | 12 +++- drivers/net/ovpn/peer.c | 2 ++ drivers/net

[PATCH net-next v13 11/22] ovpn: implement TCP transport

2024-12-06 Thread Antonio Quartulli
ess inet6_stream_ops, which is declared as extern in the IPv6 module, but it is not fully exported. Therefore this patch is also adding EXPORT_SYMBOL_GPL(inet6_stream_ops) to net/ipv6/af_inet6.c. Signed-off-by: Antonio Quartulli --- drivers/net/Kconfig | 1 + drivers/net/ovpn/Makefile |

[PATCH net-next v13 17/22] ovpn: implement peer add/get/dump/delete via netlink

2024-12-06 Thread Antonio Quartulli
This change introduces the netlink command needed to add, delete and retrieve/dump known peers. Userspace is expected to use these commands to handle known peer lifecycles. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/netlink.c | 631

[PATCH net-next v13 18/22] ovpn: implement key add/get/del/swap via netlink

2024-12-06 Thread Antonio Quartulli
This change introduces the netlink commands needed to add, get, delete and swap keys for a specific peer. Userspace is expected to use these commands to create, inspect (non sensitive data only), destroy and rotate session keys for a specific peer. Signed-off-by: Antonio Quartulli --- drivers

[PATCH net-next v13 16/22] ovpn: add support for peer floating

2024-12-06 Thread Antonio Quartulli
A peer connected via UDP may change its IP address without reconnecting (float). Add support for detecting and updating the new peer IP/port in case of floating. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/bind.c | 9 +- drivers/net/ovpn/io.c | 4 + drivers/net/ovpn/peer.c

[PATCH net-next v13 15/22] ovpn: add support for updating local UDP endpoint

2024-12-06 Thread Antonio Quartulli
In case of UDP links, the local endpoint used to communicate with a given peer may change without a connection restart. Add support for learning the new address in case of change. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/peer.c | 45

[PATCH net-next v13 22/22] testing/selftests: add test tool and scripts for ovpn module

2024-12-06 Thread Antonio Quartulli
`ping`, `iperf` and `ovpn-cli` itself. In general it is useful only in case of failure, in order to understand which step has failed and why. Cc: linux-kselft...@vger.kernel.org Signed-off-by: Antonio Quartulli Reviewed-by: Shuah Khan --- MAINTAINERS|1

[PATCH net-next v13 21/22] ovpn: add basic ethtool support

2024-12-06 Thread Antonio Quartulli
Implement support for basic ethtool functionality. Note that ovpn is a virtual device driver, therefore various ethtool APIs are just not meaningful and thus not implemented. Signed-off-by: Antonio Quartulli Reviewed-by: Andrew Lunn --- drivers/net/ovpn/main.c | 15 +++ 1 file

[PATCH net-next v13 20/22] ovpn: notify userspace when a peer is deleted

2024-12-06 Thread Antonio Quartulli
Whenever a peer is deleted, send a notification to userspace so that it can react accordingly. This is most important when a peer is deleted due to ping timeout, because it all happens in kernelspace and thus userspace has no direct way to learn about it. Signed-off-by: Antonio Quartulli

[PATCH net-next v13 07/22] ovpn: implement basic TX path (UDP)

2024-12-06 Thread Antonio Quartulli
Packets sent over the ovpn interface are processed and transmitted to the connected peer, if any. Implementation is UDP only. TCP will be added by a later patch. Note: no crypto/encapsulation exists yet. Packets are just captured and sent. Signed-off-by: Antonio Quartulli --- drivers/net

[PATCH net-next v13 19/22] ovpn: kill key and notify userspace in case of IV exhaustion

2024-12-06 Thread Antonio Quartulli
amount of traffic by periodically polling GET_PEER and fetching the VPN/LINK stats. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/crypto.c | 19 drivers/net/ovpn/crypto.h | 2 ++ drivers/net/ovpn/io.c | 13 +++ drivers/net/ovpn/netlink.c | 55

[PATCH net-next v13 00/22] Introducing OpenVPN Data Channel Offload

2024-12-06 Thread Antonio Quartulli
They have retained the Reviewed-by tag since no major code modification has happened since the review. Patch The latest code can also be found at: https://github.com/OpenVPN/linux-kernel-ovpn Thanks a lot! Best Regards, Antonio Quartulli OpenVPN Inc. --- Antonio Quartulli (22): net:

[PATCH net-next v13 02/22] ovpn: add basic netlink support

2024-12-06 Thread Antonio Quartulli
/ovpn/netlink-gen.h Cc: donald.hun...@gmail.com Signed-off-by: Antonio Quartulli --- Documentation/netlink/specs/ovpn.yaml | 368 ++ MAINTAINERS | 2 + drivers/net/ovpn/Makefile | 2 + drivers/net/ovpn/main.c

[PATCH net-next v13 01/22] net: introduce OpenVPN Data Channel Offload (ovpn)

2024-12-06 Thread Antonio Quartulli
ff-by: Antonio Quartulli --- MAINTAINERS | 8 drivers/net/Kconfig | 7 +++ drivers/net/Makefile | 1 + drivers/net/ovpn/Makefile | 10 + drivers/net/ovpn/main.c | 112 ++ 5 files changed, 138 insertions(+) diff

[PATCH net-next v13 03/22] ovpn: add basic interface creation/destruction/management routines

2024-12-06 Thread Antonio Quartulli
Add basic infrastructure for handling ovpn interfaces. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/Makefile | 1 + drivers/net/ovpn/io.c | 22 + drivers/net/ovpn/io.h | 24 ++ drivers/net/ovpn/main.c | 102

[PATCH net-next v13 14/22] ovpn: implement keepalive mechanism

2024-12-06 Thread Antonio Quartulli
OpenVPN supports configuring a periodic keepalive packet. message to allow the remote endpoint detect link failures. This change implements the keepalive sending and timer expiring logic. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/io.c | 77 + drivers/net

Re: [PATCH net-next v17 25/25] testing/selftests: add test tool and scripts for ovpn module

2025-01-11 Thread Antonio Quartulli
Hey Jakub, I just realized that I forgot to fix the nla_get_uint clash triggered on Fedora. However, I'd rather not send a new patchset right away... Maybe we will be happy with this version and then I will just resend this patch alone. Best Regards, -- Antonio Quartulli OpenVPN Inc.

[PATCH net-next v17 15/25] ovpn: implement multi-peer support

2025-01-10 Thread Antonio Quartulli
With this change an ovpn instance will be able to stay connected to multiple remote endpoints. This functionality is strictly required when running ovpn on an OpenVPN server. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/main.c | 67 +- drivers/net/ovpn

[PATCH net-next v17 18/25] ovpn: add support for updating local UDP endpoint

2025-01-10 Thread Antonio Quartulli
In case of UDP links, the local endpoint used to communicate with a given peer may change without a connection restart. Add support for learning the new address in case of change. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/peer.c | 45

[PATCH net-next v17 12/25] ovpn: implement TCP transport

2025-01-10 Thread Antonio Quartulli
ess inet6_stream_ops, which is declared as extern in the IPv6 module, but it is not fully exported. Therefore this patch is also adding EXPORT_SYMBOL_GPL(inet6_stream_ops) to net/ipv6/af_inet6.c. Signed-off-by: Antonio Quartulli --- drivers/net/Kconfig | 1 + drivers/net/ovpn/Makefile |

[PATCH net-next v17 16/25] ovpn: implement peer lookup logic

2025-01-10 Thread Antonio Quartulli
: Antonio Quartulli --- drivers/net/ovpn/peer.c | 301 ++-- 1 file changed, 291 insertions(+), 10 deletions(-) diff --git a/drivers/net/ovpn/peer.c b/drivers/net/ovpn/peer.c index ae712b64e5092cc5759fb7141d98444dbde7aac7

[PATCH net-next v17 14/25] ovpn: add support for MSG_NOSIGNAL in tcp_sendmsg

2025-01-10 Thread Antonio Quartulli
Userspace may want to pass the MSG_NOSIGNAL flag to tcp_sendmsg() in order to avoid generating a SIGPIPE. To pass this flag down the TCP stack a new skb sending API accepting a flags argument is introduced. Cc: Eric Dumazet Cc: Paolo Abeni Signed-off-by: Antonio Quartulli --- drivers/net

<    1   2   3   4   5   6   7   >