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

2024-12-02 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 v12 09/22] ovpn: implement packet processing

2024-12-02 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 v12 02/22] ovpn: add basic netlink support

2024-12-02 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 v12 10/22] ovpn: store tunnel and transport statistics

2024-12-02 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 v12 12/22] ovpn: implement multi-peer support

2024-12-02 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 v12 17/22] ovpn: implement peer add/get/dump/delete via netlink

2024-12-02 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 v12 14/22] ovpn: implement keepalive mechanism

2024-12-02 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 v12 06/22] ovpn: introduce the ovpn_socket object

2024-12-02 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 v12 04/22] ovpn: keep carrier always on for MP interfaces

2024-12-02 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 v12 22/22] testing/selftests: add test tool and scripts for ovpn module

2024-12-02 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 v12 08/22] ovpn: implement basic RX path (UDP)

2024-12-02 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

Re: [PATCH net-next v11 04/23] ovpn: add basic interface creation/destruction/management routines

2024-11-14 Thread Antonio Quartulli
On 12/11/2024 17:47, Sabrina Dubroca wrote: 2024-11-09, 03:01:21 +0200, Sergey Ryazanov wrote: On 29.10.2024 12:47, Antonio Quartulli wrote: +/* When the OpenVPN protocol is ran in AEAD mode, use + * the OpenVPN packet ID as the AEAD nonce: + * + *0005 521c3b01 4308c041 + *[seq

Re: [PATCH net-next v11 15/23] ovpn: implement keepalive mechanism

2024-11-14 Thread Antonio Quartulli
On 13/11/2024 11:36, Sabrina Dubroca wrote: 2024-11-12, 14:20:45 +0100, Antonio Quartulli wrote: On 05/11/2024 19:10, Sabrina Dubroca wrote: 2024-10-29, 11:47:28 +0100, Antonio Quartulli wrote: @@ -105,6 +132,9 @@ void ovpn_decrypt_post(void *data, int ret) goto drop

Re: [PATCH net-next v11 17/23] ovpn: add support for peer floating

2024-11-14 Thread Antonio Quartulli
On 13/11/2024 12:25, Sabrina Dubroca wrote: 2024-11-12, 15:03:00 +0100, Antonio Quartulli wrote: On 12/11/2024 11:56, Sabrina Dubroca wrote: 2024-10-29, 11:47:30 +0100, Antonio Quartulli wrote: diff --git a/drivers/net/ovpn/io.c b/drivers/net/ovpn/io.c index

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

2024-11-14 Thread Antonio Quartulli
On 10/11/2024 20:52, Sergey Ryazanov wrote: On 29.10.2024 12:47, Antonio Quartulli wrote: [...] +static void ovpn_peer_release(struct ovpn_peer *peer) +{ +    ovpn_bind_reset(peer, NULL); + nit: this empty line after ovpn_bind_reset() is removed in the 'implement basic TX path (UDP)&#

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

2024-11-14 Thread Antonio Quartulli
On 13/11/2024 17:56, Sabrina Dubroca wrote: 2024-11-12, 15:19:50 +0100, Antonio Quartulli wrote: On 04/11/2024 16:14, Sabrina Dubroca wrote: 2024-10-29, 11:47:31 +0100, Antonio Quartulli wrote: +static int ovpn_nl_peer_precheck(struct ovpn_struct *ovpn, +struct

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

2024-11-14 Thread Antonio Quartulli
On 13/11/2024 15:28, Sabrina Dubroca wrote: 2024-11-12, 16:44:09 +0100, Antonio Quartulli wrote: On 05/11/2024 11:33, Sabrina Dubroca wrote: 2024-10-29, 11:47:33 +0100, Antonio Quartulli wrote: +int ovpn_nl_key_swap_notify(struct ovpn_peer *peer, u8 key_id) +{ [...] + + nla_nest_end

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

2024-11-14 Thread Antonio Quartulli
T_OVPN_UDP_H_ +#include +#include + +struct ovpn_peer;   struct ovpn_struct; +struct sk_buff; This declaration looks odd since we already have skbuff.h included above. I believe originally there was no include, then I need to add that. Will double check, Thanks a lot! Regards, -- Antonio Quartulli OpenVPN Inc.

Re: [PATCH net-next v11 00/23] Introducing OpenVPN Data Channel Offload

2024-11-14 Thread Antonio Quartulli
On 06/11/2024 02:18, Sergey Ryazanov wrote: Hi Antonio, On 29.10.2024 12:47, Antonio Quartulli wrote: Notable changes from v10: * extended commit message of 23/23 with brief description of the output * Link to v10: https://lore.kernel.org/r/20241025-b4-ovpn-v10-0- b87530777...@openvpn.net

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

2024-11-14 Thread Antonio Quartulli
On 13/11/2024 12:05, Sabrina Dubroca wrote: 2024-11-12, 15:26:59 +0100, Antonio Quartulli wrote: On 11/11/2024 16:41, Sabrina Dubroca wrote: 2024-10-29, 11:47:31 +0100, Antonio Quartulli wrote: +void ovpn_peer_hash_vpn_ip(struct ovpn_peer *peer) + __must_hold(&peer->ovpn->p

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

2024-11-25 Thread Antonio Quartulli
7;d like to keep it as it is to avoid the ovpn interface to make decisions on its own. I can spell this out in the comment (I think it definitely makes sense), to clarify that the netcarrier is expected to be driven by userspace (where the control plane is) rather than having the device make decisions without having the full picture. What do you think? Regards, -- Antonio Quartulli OpenVPN Inc.

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

2024-11-26 Thread Antonio Quartulli
either. Can you please point out the code where other virtual drivers are doing what you are suggesting so I can have a look? Wireguard is the closest module in terms of concept and I couldn't see anything like that. Neither in ipsec. But I may have overlooked something. Please let me know. Regards, -- Antonio Quartulli OpenVPN Inc.

Re: [PATCH net-next v11 12/23] ovpn: implement TCP transport

2024-11-26 Thread Antonio Quartulli
On 26/11/2024 02:05, Sergey Ryazanov wrote: Hi Antonio, the question was addressed to Sabrina, but since I've already touched this topic in the another patch, let me put my 2c here. On 16.11.2024 02:33, Antonio Quartulli wrote: On 31/10/2024 16:25, Sabrina Dubroca wrote: 2024-10-29,

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

2024-11-26 Thread Antonio Quartulli
On 26/11/2024 01:32, Sergey Ryazanov wrote: On 15.11.2024 17:02, Antonio Quartulli wrote: On 11/11/2024 02:54, Sergey Ryazanov wrote: [...] +/* Called after decrypt to write the IP packet to the device. + * This method is expected to manage/free the skb. + */ +static void ovpn_netdev_write

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

2024-12-01 Thread Antonio Quartulli
is done and can release the peer. Regards, -- Antonio Quartulli OpenVPN Inc.

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

2024-12-01 Thread Antonio Quartulli
On 29/11/2024 17:10, Sabrina Dubroca wrote: 2024-11-26, 02:32:38 +0200, Sergey Ryazanov wrote: On 15.11.2024 17:02, Antonio Quartulli wrote: On 11/11/2024 02:54, Sergey Ryazanov wrote: [...] +    skb_reset_transport_header(skb); +    skb_probe_transport_header(skb

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

2024-12-01 Thread Antonio Quartulli
On 29/11/2024 18:00, Sabrina Dubroca wrote: 2024-11-14, 11:32:36 +0100, Antonio Quartulli wrote: On 13/11/2024 12:05, Sabrina Dubroca wrote: 2024-11-12, 15:26:59 +0100, Antonio Quartulli wrote: On 11/11/2024 16:41, Sabrina Dubroca wrote: 2024-10-29, 11:47:31 +0100, Antonio Quartulli wrote

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

2024-12-01 Thread Antonio Quartulli
On 29/11/2024 14:20, Sabrina Dubroca wrote: 2024-11-27, 02:40:02 +0100, Antonio Quartulli wrote: On 26/11/2024 09:49, Antonio Quartulli wrote: [...] The potential issue is tricky since we create it patch-by-patch. Up to this patch the socket releasing procedure looks solid and reliable. E.g

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

2024-12-02 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

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

2024-12-03 Thread Antonio Quartulli
On 02/12/2024 16:07, Antonio Quartulli wrote: [...] +/** + * ovpn_udp_output - transmit skb using udp-tunnel + * @peer: the destination peer + * @cache: dst cache + * @sk: the socket to send the packet over + * @skb: the packet to send + * + * rcu_read_lock should be held on entry. + * On return

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

2024-12-03 Thread Antonio Quartulli
On 02/12/2024 16:07, Antonio Quartulli wrote: [...] +#define ovpn_get_hash_slot(_key, _key_len, _tbl) ({\ + typeof(_tbl) *__tbl = &(_tbl); \ + jhash(_key, _key_len, 0) % HASH_SIZE(*__tbl); \ +}) + +#define ovpn_get_hash_head(_tbl, _key, _key

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

2024-12-03 Thread Antonio Quartulli
On 03/12/2024 15:58, Paolo Abeni wrote: On 12/2/24 16:07, Antonio Quartulli wrote: @@ -286,6 +292,31 @@ struct ovpn_peer *ovpn_peer_get_by_dst(struct ovpn_priv *ovpn, return peer; } +/** + * ovpn_peer_check_by_src - check that skb source is routed via peer + * @ovpn: the openvpn

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

2024-12-03 Thread Antonio Quartulli
This is a no-op after the previous call. You should drop it. Thanks Paolo, I'll drop it. Regards, -- Antonio Quartulli OpenVPN Inc.

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

2024-12-05 Thread Antonio Quartulli
On 02/12/2024 16:07, Antonio Quartulli wrote: [...] + +/** + * ovpn_peer_unhash - remove peer reference from all hashtables + * @peer: the peer to remove + * @reason: the delete reason to attach to the peer + */ +static void ovpn_peer_unhash(struct ovpn_peer *peer

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

2024-12-04 Thread Antonio Quartulli
On 03/12/2024 17:09, Sabrina Dubroca wrote: 2024-12-03, 15:58:17 +0100, Antonio Quartulli wrote: On 02/12/2024 16:07, Antonio Quartulli wrote: [...] +#define ovpn_get_hash_slot(_key, _key_len, _tbl) ({\ + typeof(_tbl) *__tbl = &(_tbl); \ + jhash(

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

2024-12-04 Thread Antonio Quartulli
On 03/12/2024 18:46, Paolo Abeni wrote: On 12/2/24 16:07, 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 the user request + * @attrs: the attributes from the

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

2024-12-04 Thread Antonio Quartulli
On 03/12/2024 16:19, Paolo Abeni wrote: On 12/2/24 16:07, Antonio Quartulli wrote: +void ovpn_tcp_socket_detach(struct socket *sock) +{ + struct ovpn_socket *ovpn_sock; + struct ovpn_peer *peer; + + if (!sock) + return; + + rcu_read_lock

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

2024-12-04 Thread Antonio Quartulli
On 04/12/2024 09:28, Antonio Quartulli wrote: On 03/12/2024 17:09, Sabrina Dubroca wrote: 2024-12-03, 15:58:17 +0100, Antonio Quartulli wrote: On 02/12/2024 16:07, Antonio Quartulli wrote: [...] +#define ovpn_get_hash_slot(_key, _key_len, _tbl) ({    \ +    typeof(_tbl) *__tbl = &(

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

2024-12-04 Thread Antonio Quartulli
On 04/12/2024 12:15, Antonio Quartulli wrote: [...] +static void ovpn_tcp_close(struct sock *sk, long timeout) +{ +    struct ovpn_socket *sock; + +    rcu_read_lock(); +    sock = rcu_dereference_sk_user_data(sk); + +    strp_stop(&sock->peer->tcp.strp); +    barrier(); Again, is no

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

2024-12-04 Thread Antonio Quartulli
Paolo, On 04/12/2024 12:15, Antonio Quartulli wrote: [...] +    mutex_lock(&tcp6_prot_mutex); +    if (!ovpn_tcp6_prot.recvmsg) +    ovpn_tcp_build_protos(&ovpn_tcp6_prot, &ovpn_tcp6_ops, +  sock->sk->sk_prot, +

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

2024-12-04 Thread Antonio Quartulli
On 04/12/2024 23:52, Antonio Quartulli wrote: Paolo, On 04/12/2024 12:15, Antonio Quartulli wrote: [...] +    mutex_lock(&tcp6_prot_mutex); +    if (!ovpn_tcp6_prot.recvmsg) +    ovpn_tcp_build_protos(&ovpn_tcp6_prot, &ovpn_tcp6_ops, +  sock-

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

2024-12-09 Thread Antonio Quartulli
On 09/12/2024 11:46, Matthieu Baerts wrote: Hi Antonio, Thank you for working on this, and sharing your work here! On 05/12/2024 00:09, Antonio Quartulli wrote: On 04/12/2024 23:52, Antonio Quartulli wrote: Paolo, On 04/12/2024 12:15, Antonio Quartulli wrote: [...] +    mutex_lock

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

2024-12-09 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 v14 00/22] Introducing OpenVPN Data Channel Offload

2024-12-09 Thread Antonio Quartulli
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) ovpn: add basic netlink support ovpn

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

2024-12-09 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 v14 05/22] ovpn: introduce the ovpn_peer object

2024-12-09 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 v14 07/22] ovpn: implement basic TX path (UDP)

2024-12-09 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 v14 06/22] ovpn: introduce the ovpn_socket object

2024-12-09 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 v14 04/22] ovpn: keep carrier always on for MP interfaces

2024-12-09 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 v14 12/22] ovpn: implement multi-peer support

2024-12-09 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 v14 13/22] ovpn: implement peer lookup logic

2024-12-09 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 v14 17/22] ovpn: implement peer add/get/dump/delete via netlink

2024-12-09 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 v14 16/22] ovpn: add support for peer floating

2024-12-09 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 v14 20/22] ovpn: notify userspace when a peer is deleted

2024-12-09 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 v14 01/22] net: introduce OpenVPN Data Channel Offload (ovpn)

2024-12-09 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 v14 03/22] ovpn: add basic interface creation/destruction/management routines

2024-12-09 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 v14 09/22] ovpn: implement packet processing

2024-12-09 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 v14 10/22] ovpn: store tunnel and transport statistics

2024-12-09 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 v14 14/22] ovpn: implement keepalive mechanism

2024-12-09 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 v14 18/22] ovpn: implement key add/get/del/swap via netlink

2024-12-09 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 v14 15/22] ovpn: add support for updating local UDP endpoint

2024-12-09 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 v14 19/22] ovpn: kill key and notify userspace in case of IV exhaustion

2024-12-09 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 v14 22/22] testing/selftests: add test tool and scripts for ovpn module

2024-12-09 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 v14 21/22] ovpn: add basic ethtool support

2024-12-09 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 v14 11/22] ovpn: implement TCP transport

2024-12-09 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

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

2024-12-09 Thread Antonio Quartulli
On 09/12/2024 12:31, Matthieu Baerts wrote: On 09/12/2024 11:58, Antonio Quartulli wrote: On 09/12/2024 11:46, Matthieu Baerts wrote: Hi Antonio, Thank you for working on this, and sharing your work here! On 05/12/2024 00:09, Antonio Quartulli wrote: On 04/12/2024 23:52, Antonio Quartulli

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

2025-01-05 Thread Antonio Quartulli
Hi Sabrina, On 03/01/2025 18:00, Sabrina Dubroca wrote: Hello Antonio, 2024-12-19, 02:42:01 +0100, Antonio Quartulli wrote: +static void ovpn_socket_release_kref(struct kref *kref) + __releases(sock->sock->sk) +{ + struct ovpn_socket *sock = container_of(kref, struct ovpn_

Re: [PATCH net-next v18 20/25] ovpn: implement peer add/get/dump/delete via netlink

2025-02-03 Thread Antonio Quartulli
On 03/02/2025 00:07, Sabrina Dubroca wrote: 2025-01-13, 10:31:39 +0100, Antonio Quartulli wrote: +static int ovpn_nl_attr_sockaddr_remote(struct nlattr **attrs, + struct sockaddr_storage *ss) +{ + struct sockaddr_in6 *sin6; + struct sockaddr_in

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

2025-02-03 Thread Antonio Quartulli
On 03/02/2025 10:30, Sabrina Dubroca wrote: 2025-01-13, 10:31:27 +0100, Antonio Quartulli wrote: +/** + * ovpn_opcode_from_skb - extract OP code from skb at specified offset + * @skb: the packet to extract the OP code from + * @offset: the offset in the data buffer where the OP code is

Re: [PATCH net-next v18 17/25] ovpn: implement keepalive mechanism

2025-02-03 Thread Antonio Quartulli
On 03/02/2025 10:20, Sabrina Dubroca wrote: 2025-01-13, 10:31:36 +0100, Antonio Quartulli wrote: +void ovpn_xmit_special(struct ovpn_peer *peer, const void *data, + const unsigned int len) +{ + struct ovpn_priv *ovpn; + struct sk_buff *skb; + + ovpn = peer

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

2025-02-03 Thread Antonio Quartulli
On 03/02/2025 00:00, Sabrina Dubroca wrote: 2025-01-13, 10:31:34 +0100, 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 v18 12/25] ovpn: implement TCP transport

2025-02-03 Thread Antonio Quartulli
On 03/02/2025 11:05, Sabrina Dubroca wrote: 2025-01-13, 10:31:31 +0100, Antonio Quartulli wrote: +static void ovpn_tcp_rcv(struct strparser *strp, struct sk_buff *skb) +{ [...] + /* we need the first byte of data to be accessible +* to extract the opcode and the key ID later on

Re: [PATCH net-next v18 07/25] ovpn: implement basic TX path (UDP)

2025-02-05 Thread Antonio Quartulli
On 04/02/2025 17:18, Sabrina Dubroca wrote: 2025-02-03, 10:52:41 +0100, Sabrina Dubroca wrote: 2025-01-13, 10:31:26 +0100, Antonio Quartulli wrote: +static void ovpn_encrypt_post(struct sk_buff *skb, int ret) +{ + struct ovpn_peer *peer = ovpn_skb_cb(skb)->peer; + + if (unlik

Re: [PATCH net-next v18 09/25] ovpn: implement packet processing

2025-02-07 Thread Antonio Quartulli
On 05/02/2025 22:50, Sabrina Dubroca wrote: Hi Antonio, Another one I should have spotted a long time ago :( better late than never (I think..) 2025-01-13, 10:31:28 +0100, Antonio Quartulli wrote: +int ovpn_aead_encrypt(struct ovpn_peer *peer, struct ovpn_crypto_key_slot *ks

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

2025-02-10 Thread Antonio Quartulli
/ovpn/netlink-gen.h Reviewed-by: Donald Hunter 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 v19 01/26] net: introduce OpenVPN Data Channel Offload (ovpn)

2025-02-10 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 v19 09/26] ovpn: implement packet processing

2025-02-10 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 v19 11/26] ipv6: export inet6_stream_ops via EXPORT_SYMBOL_GPL

2025-02-10 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 v19 15/26] ovpn: implement multi-peer support

2025-02-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/ovpnpriv.h

[PATCH net-next v19 16/26] ovpn: implement peer lookup logic

2025-02-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 ede0e2afc05b22882e1720aa44cdacb44a42bcf4

[PATCH net-next v19 12/26] ovpn: implement TCP transport

2025-02-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 | 1 + driv

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

2025-02-10 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 v19 10/26] ovpn: store tunnel and transport statistics

2025-02-10 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 v19 13/26] skb: implement skb_send_sock_locked_with_flags()

2025-02-10 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 v19 14/26] ovpn: add support for MSG_NOSIGNAL in tcp_sendmsg

2025-02-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

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

2025-02-10 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 | 2

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

2025-02-10 Thread Antonio Quartulli
Add basic infrastructure for handling ovpn interfaces. Tested-by: Donald Hunter 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

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

2025-02-10 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 v19 06/26] ovpn: introduce the ovpn_socket object

2025-02-10 Thread Antonio Quartulli
a later patch. Cc: willemdebruijn.ker...@gmail.com Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/Makefile | 2 + drivers/net/ovpn/peer.c | 5 ++ drivers/net/ovpn/peer.h | 4 + drivers/net/ovpn/socket.c | 190 ++ drivers/net/ovpn

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

2025-02-10 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 v19 17/26] ovpn: implement keepalive mechanism

2025-02-10 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 | 74 + drivers/net/ovpn

[PATCH net-next v19 19/26] ovpn: add support for peer floating

2025-02-10 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 | 8 ++ drivers/net/ovpn/peer.c | 243

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

2025-02-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 v19 20/26] ovpn: implement peer add/get/dump/delete via netlink

2025-02-10 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 | 676

[PATCH net-next v19 24/26] ovpn: add basic ethtool support

2025-02-10 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 v19 00/26] Introducing OpenVPN Data Channel Offload

2025-02-10 Thread Antonio Quartulli
I: 7ffd9d3763c0 [ 1056.319740] RBP: 7ffd9d3763d0 R08: R09: 00034608 [ 1056.319740] R10: 7fa5fb829000 R11: 0297 R12: 7ffd9d376450 [ 1056.319740] R13: 7ffd9d3763c0 R14: 00000001 R15: 0001 [ 1056.319740] Thanks a lot! Best Regards, Antoni

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

2025-02-10 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 | 64

[PATCH net-next v19 26/26] mailmap: remove unwanted entry for Antonio Quartulli

2025-02-10 Thread Antonio Quartulli
anto...@openvpn.net is still used for sending patches under the OpenVPN Inc. umbrella, therefore this address should not be re-mapped. Cc: Andrew Morton Signed-off-by: Antonio Quartulli --- .mailmap | 1 - 1 file changed, 1 deletion(-) diff --git a/.mailmap b/.mailmap index

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

2025-02-10 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 v19 25/26] testing/selftests: add test tool and scripts for ovpn module

2025-02-10 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

<    1   2   3   4   5   6   7   >