| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/24 07:58 | flow | patch-triage |
4mArgs:null Results: {
"EnableConfigs": [
"OVPN"
],
"FocusSymbols": [
"ovpn_nl_peer_del_notify",
"ovpn_nl_fill_peer",
"ovpn_nl_send_peer",
"ovpn_decrypt_post",
"ovpn_encrypt_post"
],
"KMSANReasoning": "The patch series refactors netlink peer attribute formatting by extracting ovpn_nl_fill_peer() from ovpn_nl_send_peer() and reusing it in ovpn_nl_peer_del_notify(). In addition, it removes redundant peer null-checks in ovpn_decrypt_post() and ovpn_encrypt_post(), removes an unused work_struct field from struct ovpn_socket, updates documentation in bind.c, and updates selftests.\n\nAll peer and socket data structures in ovpn are allocated via kzalloc_obj, ensuring all fields are zero-initialized upon creation. The netlink attributes added to peer deletion notifications use standard typed nla_put helpers (e.g., nla_put_u32, nla_put_in_addr, nla_put_in6_addr, nla_put_uint) without copying uninitialized memory or struct padding to userspace. No uninitialized stack or heap data is introduced, modified, or branched upon. Any potential bugs introduced by these changes (such as reference counting issues with ovpn_peer_put, NULL pointer dereferences, or netlink skb allocation failures) are covered by standard kernel debuggers, KASAN, and LOCKDEP. Therefore, dedicated KMSAN fuzzing is not warranted.",
"NeedsKMSAN": false,
"Reasoning": "The patch modifies executable code in the OpenVPN data channel offload (ovpn) driver. Specifically, it updates ovpn_decrypt_post and ovpn_encrypt_post to drop peer references unconditionally, refactors netlink peer serialization by introducing ovpn_nl_fill_peer to handle both peer get queries and peer deletion notifications (passing a NULL genl_info), and removes an unused work_struct field from struct ovpn_socket. These changes modify reachable network device logic and generic netlink notification handling, making them relevant for fuzzing.",
"WorthFuzzing": true
} |
| 1/1 | 2026/09/24 07:58 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 5bf582250437d57dbc82cb83a2732ff5df13635c\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Thu Sep 24 07:58:20 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/drivers/net/ovpn/bind.c b/drivers/net/ovpn/bind.c\nindex e42b60cd04a98..62a5ccfd3502a 100644\n--- a/drivers/net/ovpn/bind.c\n+++ b/drivers/net/ovpn/bind.c\n@@ -18,7 +18,7 @@\n * ovpn_bind_from_sockaddr - retrieve binding matching sockaddr\n * @ss: the sockaddr to match\n *\n- * Return: the bind matching the passed sockaddr if found, NULL otherwise\n+ * Return: the new bind for the passed sockaddr, an ERR_PTR() on failure\n */\n struct ovpn_bind *ovpn_bind_from_sockaddr(const struct sockaddr_storage *ss)\n {\ndiff --git a/drivers/net/ovpn/io.c b/drivers/net/ovpn/io.c\nindex 9526f8096da60..f14eb4e6c46ad 100644\n--- a/drivers/net/ovpn/io.c\n+++ b/drivers/net/ovpn/io.c\n@@ -206,8 +206,7 @@ void ovpn_decrypt_post(void *data, int ret)\n drop_nocount:\n \tif (likely(ks))\n \t\tovpn_crypto_key_slot_put(ks);\n-\tif (likely(peer))\n-\t\tovpn_peer_put(peer);\n+\tovpn_peer_put(peer);\n }\n \n /* RX path entry point: decrypt packet and forward it to the device */\n@@ -305,8 +304,7 @@ void ovpn_encrypt_post(void *data, int ret)\n \tkfree_skb(skb);\n \tif (likely(ks))\n \t\tovpn_crypto_key_slot_put(ks);\n-\tif (likely(peer))\n-\t\tovpn_peer_put(peer);\n+\tovpn_peer_put(peer);\n }\n \n static bool ovpn_encrypt_one(struct ovpn_peer *peer, struct sk_buff *skb)\ndiff --git a/drivers/net/ovpn/netlink.c b/drivers/net/ovpn/netlink.c\nindex 4dad852941982..aaca0612d6f4c 100644\n--- a/drivers/net/ovpn/netlink.c\n+++ b/drivers/net/ovpn/netlink.c\n@@ -546,27 +546,15 @@ int ovpn_nl_peer_set_doit(struct sk_buff *skb, struct genl_info *info)\n \treturn 0;\n }\n \n-static int ovpn_nl_send_peer(struct sk_buff *skb, const struct genl_info *info,\n-\t\t\t const struct ovpn_peer *peer, u32 portid, u32 seq,\n-\t\t\t int flags)\n+static int ovpn_nl_fill_peer(struct sk_buff *skb, const struct genl_info *info,\n+\t\t\t const struct ovpn_peer *peer)\n {\n \tconst struct ovpn_bind *bind;\n \tstruct ovpn_socket *sock;\n \tint ret = -EMSGSIZE;\n-\tstruct nlattr *attr;\n \t__be16 local_port;\n-\tvoid *hdr;\n \tint id;\n \n-\thdr = genlmsg_put(skb, portid, seq, \u0026ovpn_nl_family, flags,\n-\t\t\t OVPN_CMD_PEER_GET);\n-\tif (!hdr)\n-\t\treturn -ENOBUFS;\n-\n-\tattr = nla_nest_start(skb, OVPN_A_PEER);\n-\tif (!attr)\n-\t\tgoto err;\n-\n \trcu_read_lock();\n \tsock = rcu_dereference(peer-\u003esock);\n \tif (!sock) {\n@@ -574,7 +562,7 @@ static int ovpn_nl_send_peer(struct sk_buff *skb, const struct genl_info *info,\n \t\tgoto err_unlock;\n \t}\n \n-\tif (!net_eq(genl_info_net(info), sock_net(sock-\u003esk))) {\n+\tif (info \u0026\u0026 !net_eq(genl_info_net(info), sock_net(sock-\u003esk))) {\n \t\tid = peernet2id_alloc(genl_info_net(info),\n \t\t\t\t sock_net(sock-\u003esk),\n \t\t\t\t GFP_ATOMIC);\n@@ -585,26 +573,26 @@ static int ovpn_nl_send_peer(struct sk_buff *skb, const struct genl_info *info,\n \trcu_read_unlock();\n \n \tif (nla_put_u32(skb, OVPN_A_PEER_ID, peer-\u003eid))\n-\t\tgoto err;\n+\t\treturn -EMSGSIZE;\n \n \tif (nla_put_u32(skb, OVPN_A_PEER_TX_ID, peer-\u003etx_id))\n-\t\tgoto err;\n+\t\treturn -EMSGSIZE;\n \n \tif (peer-\u003evpn_addrs.ipv4.s_addr != htonl(INADDR_ANY))\n \t\tif (nla_put_in_addr(skb, OVPN_A_PEER_VPN_IPV4,\n \t\t\t\t peer-\u003evpn_addrs.ipv4.s_addr))\n-\t\t\tgoto err;\n+\t\t\treturn -EMSGSIZE;\n \n \tif (!ipv6_addr_equal(\u0026peer-\u003evpn_addrs.ipv6, \u0026in6addr_any))\n \t\tif (nla_put_in6_addr(skb, OVPN_A_PEER_VPN_IPV6,\n \t\t\t\t \u0026peer-\u003evpn_addrs.ipv6))\n-\t\t\tgoto err;\n+\t\t\treturn -EMSGSIZE;\n \n \tif (nla_put_u32(skb, OVPN_A_PEER_KEEPALIVE_INTERVAL,\n \t\t\tpeer-\u003ekeepalive_interval) ||\n \t nla_put_u32(skb, OVPN_A_PEER_KEEPALIVE_TIMEOUT,\n \t\t\tpeer-\u003ekeepalive_timeout))\n-\t\tgoto err;\n+\t\treturn -EMSGSIZE;\n \n \trcu_read_lock();\n \tbind = rcu_dereference(peer-\u003ebind);\n@@ -652,14 +640,39 @@ static int ovpn_nl_send_peer(struct sk_buff *skb, const struct genl_info *info,\n \t\t\t atomic64_read(\u0026peer-\u003elink_stats.tx.bytes)) ||\n \t nla_put_uint(skb, OVPN_A_PEER_LINK_TX_PACKETS,\n \t\t\t atomic64_read(\u0026peer-\u003elink_stats.tx.packets)))\n+\t\treturn -EMSGSIZE;\n+\n+\treturn 0;\n+err_unlock:\n+\trcu_read_unlock();\n+\treturn ret;\n+}\n+\n+static int ovpn_nl_send_peer(struct sk_buff *skb, const struct genl_info *info,\n+\t\t\t const struct ovpn_peer *peer, u32 portid, u32 seq,\n+\t\t\t int flags)\n+{\n+\tstruct nlattr *attr;\n+\tint ret = -EMSGSIZE;\n+\tvoid *hdr;\n+\n+\thdr = genlmsg_put(skb, portid, seq, \u0026ovpn_nl_family, flags,\n+\t\t\t OVPN_CMD_PEER_GET);\n+\tif (!hdr)\n+\t\treturn -ENOBUFS;\n+\n+\tattr = nla_nest_start(skb, OVPN_A_PEER);\n+\tif (!attr)\n+\t\tgoto err;\n+\n+\tret = ovpn_nl_fill_peer(skb, info, peer);\n+\tif (ret \u003c 0)\n \t\tgoto err;\n \n \tnla_nest_end(skb, attr);\n \tgenlmsg_end(skb, hdr);\n \n \treturn 0;\n-err_unlock:\n-\trcu_read_unlock();\n err:\n \tgenlmsg_cancel(skb, hdr);\n \treturn ret;\n@@ -1193,7 +1206,8 @@ int ovpn_nl_peer_del_notify(struct ovpn_peer *peer)\n \tif (nla_put_u32(msg, OVPN_A_PEER_DEL_REASON, peer-\u003edelete_reason))\n \t\tgoto err_cancel_msg;\n \n-\tif (nla_put_u32(msg, OVPN_A_PEER_ID, peer-\u003eid))\n+\tret = ovpn_nl_fill_peer(msg, NULL, peer);\n+\tif (ret \u003c 0)\n \t\tgoto err_cancel_msg;\n \n \tnla_nest_end(msg, attr);\ndiff --git a/drivers/net/ovpn/socket.h b/drivers/net/ovpn/socket.h\nindex 4afcec71040d9..5c87392ecd304 100644\n--- a/drivers/net/ovpn/socket.h\n+++ b/drivers/net/ovpn/socket.h\n@@ -24,7 +24,6 @@ struct ovpn_peer;\n * @peer: unique peer transmitting over this socket (TCP only)\n * @sk: the low level sock object\n * @refcount: amount of contexts currently referencing this object\n- * @work: member used to schedule release routine (it may block)\n * @tcp_tx_work: work for deferring outgoing packet processing (TCP only)\n */\n struct ovpn_socket {\n@@ -38,7 +37,6 @@ struct ovpn_socket {\n \n \tstruct sock *sk;\n \tstruct kref refcount;\n-\tstruct work_struct work;\n \tstruct work_struct tcp_tx_work;\n };\n \ndiff --git a/tools/testing/selftests/net/ovpn/common.sh b/tools/testing/selftests/net/ovpn/common.sh\nindex 2d844eb3aa6e3..611d528c7de88 100644\n--- a/tools/testing/selftests/net/ovpn/common.sh\n+++ b/tools/testing/selftests/net/ovpn/common.sh\n@@ -19,9 +19,42 @@ OVPN_VERBOSE=${OVPN_VERBOSE:-0}\n \n export OVPN_ID_OFFSET=$(( 9 * (OVPN_SYMMETRIC_ID == 0) ))\n \n-OVPN_JQ_FILTER='map(if type == \"array\" then .[] else . end) |\n-\tmap(select(.msg.peer | has(\"remote-ipv6\") | not)) |\n-\tmap(del(.msg.ifindex)) | sort_by(.msg.peer.id)[]'\n+# Peer delete notifications include traffic counters whose values depend on\n+# timing. zero_attr() sets a counter to zero only when that counter is present,\n+# so missing stats still fail the comparison. zero_peer_stats is just the list\n+# of counters to normalize. normalize_peer_del_ntf applies that to peer-del-ntf\n+# messages and drops transport endpoint details, while leaving other\n+# notifications unchanged.\n+OVPN_JQ_FILTER='\n+\tdef zero_attr(key):\n+\t\tif has(key) then .[key] = 0 else . end;\n+\n+\tdef zero_peer_stats:\n+\t\tzero_attr(\"vpn-rx-bytes\") |\n+\t\tzero_attr(\"vpn-rx-packets\") |\n+\t\tzero_attr(\"vpn-tx-bytes\") |\n+\t\tzero_attr(\"vpn-tx-packets\") |\n+\t\tzero_attr(\"link-rx-bytes\") |\n+\t\tzero_attr(\"link-rx-packets\") |\n+\t\tzero_attr(\"link-tx-bytes\") |\n+\t\tzero_attr(\"link-tx-packets\");\n+\n+\tdef normalize_peer_del_ntf:\n+\t\tif .name == \"peer-del-ntf\" then\n+\t\t\t.msg.peer |= (\n+\t\t\t\tdel(.[\"remote-ipv4\"], .[\"remote-ipv6\"],\n+\t\t\t\t .[\"remote-ipv6-scope-id\"], .[\"remote-port\"],\n+\t\t\t\t .[\"local-ipv4\"], .[\"local-ipv6\"],\n+\t\t\t\t .[\"local-port\"]) |\n+\t\t\t\tzero_peer_stats\n+\t\t\t)\n+\t\telse . end;\n+\n+\tmap(if type == \"array\" then .[] else . end) |\n+\tmap(del(.msg.ifindex)) |\n+\tmap(normalize_peer_del_ntf) |\n+\tsort_by(.msg.peer.id)[]'\n+\n OVPN_LAN_IP=\"11.11.11.11\"\n \n declare -A OVPN_TMP_JSONS=()\n@@ -178,20 +211,14 @@ ovpn_setup_ns() {\n \n ovpn_build_capture_filter() {\n \t# match the first four bytes of the openvpn data payload\n-\tif [ \"${OVPN_PROTO}\" == \"UDP\" ]; then\n-\t\t# For UDP, libpcap transport indexing only works for IPv4, so\n-\t\t# use an explicit IPv4 or IPv6 expression based on the peer\n-\t\t# address. The IPv6 branch assumes there are no extension\n-\t\t# headers in the outer packet.\n-\t\tif [[ \"${2}\" == *:* ]]; then\n-\t\t\tprintf \"ip6 and ip6[6] = 17 and ip6[48:4] = %s\" \"${1}\"\n-\t\telse\n-\t\t\tprintf \"ip and udp[8:4] = %s\" \"${1}\"\n-\t\tfi\n+\t# For UDP, libpcap transport indexing only works for IPv4, so\n+\t# use an explicit IPv4 or IPv6 expression based on the peer\n+\t# address. The IPv6 branch assumes there are no extension\n+\t# headers in the outer packet.\n+\tif [[ \"${2}\" == *:* ]]; then\n+\t\tprintf \"ip6 and ip6[6] = 17 and ip6[48:4] = %s\" \"${1}\"\n \telse\n-\t\t# openvpn over TCP prepends a 2-byte packet length ahead of the\n-\t\t# DATA_V2 opcode, so skip it before matching the payload header\n-\t\tprintf \"ip and tcp[(((tcp[12] \u0026 0xf0) \u003e\u003e 2) + 2):4] = %s\" \"${1}\"\n+\t\tprintf \"ip and udp[8:4] = %s\" \"${1}\"\n \tfi\n }\n \ndiff --git a/tools/testing/selftests/net/ovpn/json/peer0-float.json b/tools/testing/selftests/net/ovpn/json/peer0-float.json\nindex 682fa58ad4ea8..9711f2cf9cf60 100644\n--- a/tools/testing/selftests/net/ovpn/json/peer0-float.json\n+++ b/tools/testing/selftests/net/ovpn/json/peer0-float.json\n@@ -1,9 +1,9 @@\n {\"name\": \"peer-float-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"id\": 1, \"remote-ipv4\": \"10.10.1.3\", \"remote-port\": 1}}}\n {\"name\": \"peer-float-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"id\": 2, \"remote-ipv4\": \"10.10.2.3\", \"remote-port\": 1}}}\n {\"name\": \"peer-float-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"id\": 3, \"remote-ipv4\": \"10.10.3.3\", \"remote-port\": 1}}}\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 1}}}\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 2}}}\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 3}}}\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 4}}}\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 5}}}\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 6}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 1, \"tx-id\": 10, \"vpn-ipv4\": \"5.5.5.2\", \"keepalive-interval\": 60, \"keepalive-timeout\": 120, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 2, \"tx-id\": 11, \"vpn-ipv4\": \"5.5.5.3\", \"keepalive-interval\": 60, \"keepalive-timeout\": 120, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 3, \"tx-id\": 12, \"vpn-ipv4\": \"5.5.5.4\", \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 4, \"tx-id\": 13, \"vpn-ipv4\": \"5.5.5.5\", \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 5, \"tx-id\": 14, \"vpn-ipv4\": \"5.5.5.6\", \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 6, \"tx-id\": 15, \"vpn-ipv4\": \"5.5.5.7\", \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\ndiff --git a/tools/testing/selftests/net/ovpn/json/peer0-symm-float.json b/tools/testing/selftests/net/ovpn/json/peer0-symm-float.json\ndeleted file mode 120000\nindex e31a5bd598638..0000000000000\n--- a/tools/testing/selftests/net/ovpn/json/peer0-symm-float.json\n+++ /dev/null\n@@ -1 +0,0 @@\n-peer0-float.json\n\\ No newline at end of file\ndiff --git a/tools/testing/selftests/net/ovpn/json/peer0-symm-float.json b/tools/testing/selftests/net/ovpn/json/peer0-symm-float.json\nnew file mode 100644\nindex 0000000000000..c94dcc81c80e8\n--- /dev/null\n+++ b/tools/testing/selftests/net/ovpn/json/peer0-symm-float.json\n@@ -0,0 +1,9 @@\n+{\"name\": \"peer-float-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"id\": 1, \"remote-ipv4\": \"10.10.1.3\", \"remote-port\": 1}}}\n+{\"name\": \"peer-float-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"id\": 2, \"remote-ipv4\": \"10.10.2.3\", \"remote-port\": 1}}}\n+{\"name\": \"peer-float-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"id\": 3, \"remote-ipv4\": \"10.10.3.3\", \"remote-port\": 1}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 1, \"tx-id\": 1, \"vpn-ipv4\": \"5.5.5.2\", \"keepalive-interval\": 60, \"keepalive-timeout\": 120, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 2, \"tx-id\": 2, \"vpn-ipv4\": \"5.5.5.3\", \"keepalive-interval\": 60, \"keepalive-timeout\": 120, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 3, \"tx-id\": 3, \"vpn-ipv4\": \"5.5.5.4\", \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 4, \"tx-id\": 4, \"vpn-ipv4\": \"5.5.5.5\", \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 5, \"tx-id\": 5, \"vpn-ipv4\": \"5.5.5.6\", \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 6, \"tx-id\": 6, \"vpn-ipv4\": \"5.5.5.7\", \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\ndiff --git a/tools/testing/selftests/net/ovpn/json/peer0-symm.json b/tools/testing/selftests/net/ovpn/json/peer0-symm.json\ndeleted file mode 120000\nindex 57a163048eeda..0000000000000\n--- a/tools/testing/selftests/net/ovpn/json/peer0-symm.json\n+++ /dev/null\n@@ -1 +0,0 @@\n-peer0.json\n\\ No newline at end of file\ndiff --git a/tools/testing/selftests/net/ovpn/json/peer0-symm.json b/tools/testing/selftests/net/ovpn/json/peer0-symm.json\nnew file mode 100644\nindex 0000000000000..2899913ea0643\n--- /dev/null\n+++ b/tools/testing/selftests/net/ovpn/json/peer0-symm.json\n@@ -0,0 +1,6 @@\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 1, \"tx-id\": 1, \"vpn-ipv4\": \"5.5.5.2\", \"keepalive-interval\": 60, \"keepalive-timeout\": 120, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 2, \"tx-id\": 2, \"vpn-ipv4\": \"5.5.5.3\", \"keepalive-interval\": 60, \"keepalive-timeout\": 120, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 3, \"tx-id\": 3, \"vpn-ipv4\": \"5.5.5.4\", \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 4, \"tx-id\": 4, \"vpn-ipv4\": \"5.5.5.5\", \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 5, \"tx-id\": 5, \"vpn-ipv4\": \"5.5.5.6\", \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 6, \"tx-id\": 6, \"vpn-ipv4\": \"5.5.5.7\", \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\ndiff --git a/tools/testing/selftests/net/ovpn/json/peer0.json b/tools/testing/selftests/net/ovpn/json/peer0.json\nindex 7c46a33d5ecdf..fff2a86b41ab8 100644\n--- a/tools/testing/selftests/net/ovpn/json/peer0.json\n+++ b/tools/testing/selftests/net/ovpn/json/peer0.json\n@@ -1,6 +1,6 @@\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 1}}}\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 2}}}\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 3}}}\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 4}}}\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 5}}}\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 6}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 1, \"tx-id\": 10, \"vpn-ipv4\": \"5.5.5.2\", \"keepalive-interval\": 60, \"keepalive-timeout\": 120, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 2, \"tx-id\": 11, \"vpn-ipv4\": \"5.5.5.3\", \"keepalive-interval\": 60, \"keepalive-timeout\": 120, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 3, \"tx-id\": 12, \"vpn-ipv4\": \"5.5.5.4\", \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 4, \"tx-id\": 13, \"vpn-ipv4\": \"5.5.5.5\", \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 5, \"tx-id\": 14, \"vpn-ipv4\": \"5.5.5.6\", \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 6, \"tx-id\": 15, \"vpn-ipv4\": \"5.5.5.7\", \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\ndiff --git a/tools/testing/selftests/net/ovpn/json/peer1-symm.json b/tools/testing/selftests/net/ovpn/json/peer1-symm.json\nindex 5da4ea9d51fb3..41b358e1be51c 100644\n--- a/tools/testing/selftests/net/ovpn/json/peer1-symm.json\n+++ b/tools/testing/selftests/net/ovpn/json/peer1-symm.json\n@@ -1 +1 @@\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 1}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 1, \"tx-id\": 1, \"keepalive-interval\": 60, \"keepalive-timeout\": 120, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\ndiff --git a/tools/testing/selftests/net/ovpn/json/peer1.json b/tools/testing/selftests/net/ovpn/json/peer1.json\nindex 1009d26dc14a2..6332709d2a88e 100644\n--- a/tools/testing/selftests/net/ovpn/json/peer1.json\n+++ b/tools/testing/selftests/net/ovpn/json/peer1.json\n@@ -1 +1 @@\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 10}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 10, \"tx-id\": 1, \"keepalive-interval\": 60, \"keepalive-timeout\": 120, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\ndiff --git a/tools/testing/selftests/net/ovpn/json/peer2-symm.json b/tools/testing/selftests/net/ovpn/json/peer2-symm.json\nindex 8f6db4f8c2ac4..b1840bf979e8f 100644\n--- a/tools/testing/selftests/net/ovpn/json/peer2-symm.json\n+++ b/tools/testing/selftests/net/ovpn/json/peer2-symm.json\n@@ -1 +1 @@\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 2}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 2, \"tx-id\": 2, \"keepalive-interval\": 60, \"keepalive-timeout\": 120, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\ndiff --git a/tools/testing/selftests/net/ovpn/json/peer2.json b/tools/testing/selftests/net/ovpn/json/peer2.json\nindex 44e9fad2b6221..431427e4eb53b 100644\n--- a/tools/testing/selftests/net/ovpn/json/peer2.json\n+++ b/tools/testing/selftests/net/ovpn/json/peer2.json\n@@ -1 +1 @@\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 11}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"userspace\", \"id\": 11, \"tx-id\": 2, \"keepalive-interval\": 60, \"keepalive-timeout\": 120, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\ndiff --git a/tools/testing/selftests/net/ovpn/json/peer3-symm.json b/tools/testing/selftests/net/ovpn/json/peer3-symm.json\nindex bdabd6fa2e647..f9ab2a15dd9fd 100644\n--- a/tools/testing/selftests/net/ovpn/json/peer3-symm.json\n+++ b/tools/testing/selftests/net/ovpn/json/peer3-symm.json\n@@ -1 +1 @@\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 3}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 3, \"tx-id\": 3, \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\ndiff --git a/tools/testing/selftests/net/ovpn/json/peer3.json b/tools/testing/selftests/net/ovpn/json/peer3.json\nindex d4be8ba130ae3..4f9522a664ee4 100644\n--- a/tools/testing/selftests/net/ovpn/json/peer3.json\n+++ b/tools/testing/selftests/net/ovpn/json/peer3.json\n@@ -1 +1 @@\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 12}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 12, \"tx-id\": 3, \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\ndiff --git a/tools/testing/selftests/net/ovpn/json/peer4-symm.json b/tools/testing/selftests/net/ovpn/json/peer4-symm.json\nindex c3734bb9251b0..b41ab838a304f 100644\n--- a/tools/testing/selftests/net/ovpn/json/peer4-symm.json\n+++ b/tools/testing/selftests/net/ovpn/json/peer4-symm.json\n@@ -1 +1 @@\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 4}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 4, \"tx-id\": 4, \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\ndiff --git a/tools/testing/selftests/net/ovpn/json/peer4.json b/tools/testing/selftests/net/ovpn/json/peer4.json\nindex 67d27e2d48ac9..7d6b3c8af0e46 100644\n--- a/tools/testing/selftests/net/ovpn/json/peer4.json\n+++ b/tools/testing/selftests/net/ovpn/json/peer4.json\n@@ -1 +1 @@\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 13}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 13, \"tx-id\": 4, \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\ndiff --git a/tools/testing/selftests/net/ovpn/json/peer5-symm.json b/tools/testing/selftests/net/ovpn/json/peer5-symm.json\nindex 46c4a348299d6..962def1ec16f3 100644\n--- a/tools/testing/selftests/net/ovpn/json/peer5-symm.json\n+++ b/tools/testing/selftests/net/ovpn/json/peer5-symm.json\n@@ -1 +1 @@\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 5}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 5, \"tx-id\": 5, \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\ndiff --git a/tools/testing/selftests/net/ovpn/json/peer5.json b/tools/testing/selftests/net/ovpn/json/peer5.json\nindex ecd9bd0b2f371..963dc74cdaa60 100644\n--- a/tools/testing/selftests/net/ovpn/json/peer5.json\n+++ b/tools/testing/selftests/net/ovpn/json/peer5.json\n@@ -1 +1 @@\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 14}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 14, \"tx-id\": 5, \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\ndiff --git a/tools/testing/selftests/net/ovpn/json/peer6-symm.json b/tools/testing/selftests/net/ovpn/json/peer6-symm.json\nindex aa30f2cff625b..3ff352fae60fb 100644\n--- a/tools/testing/selftests/net/ovpn/json/peer6-symm.json\n+++ b/tools/testing/selftests/net/ovpn/json/peer6-symm.json\n@@ -1 +1 @@\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 6}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 6, \"tx-id\": 6, \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\ndiff --git a/tools/testing/selftests/net/ovpn/json/peer6.json b/tools/testing/selftests/net/ovpn/json/peer6.json\nindex 7fded29c58043..0db187f3af189 100644\n--- a/tools/testing/selftests/net/ovpn/json/peer6.json\n+++ b/tools/testing/selftests/net/ovpn/json/peer6.json\n@@ -1 +1 @@\n-{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 15}}}\n+{\"name\": \"peer-del-ntf\", \"msg\": {\"ifindex\": 0, \"peer\": {\"del-reason\": \"expired\", \"id\": 15, \"tx-id\": 6, \"keepalive-interval\": 3, \"keepalive-timeout\": 3, \"vpn-rx-bytes\": 0, \"vpn-rx-packets\": 0, \"vpn-tx-bytes\": 0, \"vpn-tx-packets\": 0, \"link-rx-bytes\": 0, \"link-rx-packets\": 0, \"link-tx-bytes\": 0, \"link-tx-packets\": 0}}}\ndiff --git a/tools/testing/selftests/net/ovpn/ovpn-cli.c b/tools/testing/selftests/net/ovpn/ovpn-cli.c\nindex f4effa7580c0f..6b458a654a337 100644\n--- a/tools/testing/selftests/net/ovpn/ovpn-cli.c\n+++ b/tools/testing/selftests/net/ovpn/ovpn-cli.c\n@@ -470,6 +470,18 @@ static int ovpn_parse_key_direction(const char *dir, struct ovpn_ctx *ctx)\n \treturn 0;\n }\n \n+static int ovpn_tcp_nodelay(int socket)\n+{\n+\tint opt = 1;\n+\tint ret;\n+\n+\tret = setsockopt(socket, IPPROTO_TCP, TCP_NODELAY, \u0026opt, sizeof(opt));\n+\tif (ret \u003c 0)\n+\t\tperror(\"setsockopt for TCP_NODELAY\");\n+\n+\treturn ret;\n+}\n+\n static int ovpn_socket(struct ovpn_ctx *ctx, sa_family_t family, int proto)\n {\n \tstruct sockaddr_storage local_sock = { 0 };\n@@ -606,6 +618,12 @@ static int ovpn_accept(struct ovpn_ctx *ctx)\n \t\tgoto err;\n \t}\n \n+\tif (ovpn_tcp_nodelay(ret) \u003c 0) {\n+\t\tclose(ret);\n+\t\tret = -1;\n+\t\tgoto err;\n+\t}\n+\n \treturn ret;\n err:\n \tclose(ctx-\u003esocket);\n@@ -623,6 +641,10 @@ static int ovpn_connect(struct ovpn_ctx *ovpn)\n \t\treturn -1;\n \t}\n \n+\tret = ovpn_tcp_nodelay(s);\n+\tif (ret \u003c 0)\n+\t\tgoto err;\n+\n \tswitch (ovpn-\u003eremote.in4.sin_family) {\n \tcase AF_INET:\n \t\tsocklen = sizeof(struct sockaddr_in);\ndiff --git a/tools/testing/selftests/net/ovpn/test.sh b/tools/testing/selftests/net/ovpn/test.sh\nindex 9b5610837032f..d744c1a97d5fc 100755\n--- a/tools/testing/selftests/net/ovpn/test.sh\n+++ b/tools/testing/selftests/net/ovpn/test.sh\n@@ -67,35 +67,33 @@ ovpn_run_basic_traffic() {\n \tlocal tcpdump_timeout=\"1.5s\"\n \n \tfor p in $(seq 1 ${OVPN_NUM_PEERS}); do\n-\t\t# The first part of the data packet header consists of:\n-\t\t# - TCP only: 2 bytes for the packet length\n-\t\t# - 5 bits for opcode (\"9\" for DATA_V2)\n-\t\t# - 3 bits for key-id (\"0\" at this point)\n-\t\t# - 12 bytes for peer-id:\n-\t\t# - with asymmetric ID: \"${p}\" one way and \"${p} + 9\" the\n-\t\t#\tother way\n-\t\t# - with symmetric ID: \"${p}\" both ways\n-\t\theader1=$(printf \"0x4800000%x\" ${p})\n-\t\theader2=$(printf \"0x4800000%x\" $((p + OVPN_ID_OFFSET)))\n-\t\traddr=\"\"\n \t\tif [ \"${OVPN_PROTO}\" == \"UDP\" ]; then\n+\t\t\t# The first part of the data packet header consists of:\n+\t\t\t# - 5 bits for opcode (\"9\" for DATA_V2)\n+\t\t\t# - 3 bits for key-id (\"0\" at this point)\n+\t\t\t# - 3 bytes for peer-id:\n+\t\t\t# - with asymmetric ID: \"${p}\" one way and \"${p} + 9\" the\n+\t\t\t#\tother way\n+\t\t\t# - with symmetric ID: \"${p}\" both ways\n+\t\t\theader1=$(printf \"0x4800000%x\" ${p})\n+\t\t\theader2=$(printf \"0x4800000%x\" $((p + OVPN_ID_OFFSET)))\n \t\t\traddr=$(awk \"NR == ${p} {print \\$3}\" \\\n \t\t\t\t\"${OVPN_UDP_PEERS_FILE}\")\n+\t\t\tpeer_ns=\"ovpn_peer${p}\"\n+\n+\t\t\ttimeout ${tcpdump_timeout} ip netns exec \"${peer_ns}\" \\\n+\t\t\t\ttcpdump --immediate-mode -p -ni veth${p} -c 1 \\\n+\t\t\t\t\"$(ovpn_build_capture_filter \"${header1}\" \"${raddr}\")\" \\\n+\t\t\t\t\u003e/dev/null 2\u003e\u00261 \u0026\n+\t\t\ttcpdump_pid1=$!\n+\t\t\ttimeout ${tcpdump_timeout} ip netns exec \"${peer_ns}\" \\\n+\t\t\t\ttcpdump --immediate-mode -p -ni veth${p} -c 1 \\\n+\t\t\t\t\"$(ovpn_build_capture_filter \"${header2}\" \"${raddr}\")\" \\\n+\t\t\t\t\u003e/dev/null 2\u003e\u00261 \u0026\n+\t\t\ttcpdump_pid2=$!\n+\n+\t\t\tsleep 0.3\n \t\tfi\n-\t\tpeer_ns=\"ovpn_peer${p}\"\n-\n-\t\ttimeout ${tcpdump_timeout} ip netns exec \"${peer_ns}\" \\\n-\t\t\ttcpdump --immediate-mode -p -ni veth${p} -c 1 \\\n-\t\t\t\"$(ovpn_build_capture_filter \"${header1}\" \"${raddr}\")\" \\\n-\t\t\t\u003e/dev/null 2\u003e\u00261 \u0026\n-\t\ttcpdump_pid1=$!\n-\t\ttimeout ${tcpdump_timeout} ip netns exec \"${peer_ns}\" \\\n-\t\t\ttcpdump --immediate-mode -p -ni veth${p} -c 1 \\\n-\t\t\t\"$(ovpn_build_capture_filter \"${header2}\" \"${raddr}\")\" \\\n-\t\t\t\u003e/dev/null 2\u003e\u00261 \u0026\n-\t\ttcpdump_pid2=$!\n-\n-\t\tsleep 0.3\n \t\tovpn_cmd_ok \"send baseline traffic to peer ${p}\" \\\n \t\t\tip netns exec ovpn_peer0 \\\n \t\t\tping -qfc 100 -w 3 5.5.5.$((p + 1))\n@@ -103,8 +101,10 @@ ovpn_run_basic_traffic() {\n \t\t\tip netns exec ovpn_peer0 \\\n \t\t\tping -qfc 100 -s 3000 -w 3 5.5.5.$((p + 1))\n \n-\t\twait \"${tcpdump_pid1}\" || return 1\n-\t\twait \"${tcpdump_pid2}\" || return 1\n+\t\tif [ \"${OVPN_PROTO}\" == \"UDP\" ]; then\n+\t\t\twait \"${tcpdump_pid1}\" || return 1\n+\t\t\twait \"${tcpdump_pid2}\" || return 1\n+\t\tfi\n \tdone\n }\n \n"
} |
| 2/1 | 2026/09/24 07:58 | agent | patch-evaluator |
3mModel:core Args: null Results: {
"EnableConfigs": [
"OVPN"
],
"FocusSymbols": [
"ovpn_nl_peer_del_notify",
"ovpn_nl_fill_peer",
"ovpn_nl_send_peer",
"ovpn_decrypt_post",
"ovpn_encrypt_post"
],
"Reasoning": "The patch modifies executable code in the OpenVPN data channel offload (ovpn) driver. Specifically, it updates ovpn_decrypt_post and ovpn_encrypt_post to drop peer references unconditionally, refactors netlink peer serialization by introducing ovpn_nl_fill_peer to handle both peer get queries and peer deletion notifications (passing a NULL genl_info), and removes an unused work_struct field from struct ovpn_socket. These changes modify reachable network device logic and generic netlink notification handling, making them relevant for fuzzing.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.
IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.
================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.
- REACHABILITY IS THE PRIMARY GATE:
Fuzzing can only discover bugs in code that can actually execute in standard virtualized
environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
regardless of whether it adds assertions or complex logic.
- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
Patch authors routinely label changes as "cleanups", "refactorings", or state
"No functional change intended". Do NOT take these claims at face value.
Code refactorings that rearrange logic, introduce helper functions, or alter state management
in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
If reachable executable code is modified or refactored, it MUST be fuzzed.
- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
Even if the author believes the invariant always holds, fuzzing is essential to verify whether
an unusual sequence of operations can violate it.
================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:
- Non-kernel and non-executable changes:
* Modifications to Documentation/, comments, or spelling fixes.
* User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
that do not affect the compiled kernel image (vmlinux) or kernel modules.
* Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
that do not alter control flow or data structures.
* Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
* Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
* Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
physical PCI hot-unplug or manual sysfs driver unbinding.
* Code paths exclusive to architectures other than the target architecture.
================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
* Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
* Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
* Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
* Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).
================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:
- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
Do NOT list generic, ubiquitous functions called by almost every program in the corpus
(including, but not limited to: general memory allocators and deallocators, page fault
and trap handlers, or core synchronization primitives; this is not an exhaustive list).
Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
which severely dilutes fuzzing effort away from the actual changes.
- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
List functions that specifically implement the logic being added or altered, or direct API entrypoints
for the subsystem feature under review.
- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).
================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit 5bf582250437d57dbc82cb83a2732ff5df13635c
Author: syz-cluster <triage@syzkaller.com>
Date: Thu Sep 24 07:58:20 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/net/ovpn/bind.c b/drivers/net/ovpn/bind.c
index e42b60cd04a98..62a5ccfd3502a 100644
--- a/drivers/net/ovpn/bind.c
+++ b/drivers/net/ovpn/bind.c
@@ -18,7 +18,7 @@
* ovpn_bind_from_sockaddr - retrieve binding matching sockaddr
* @ss: the sockaddr to match
*
- * Return: the bind matching the passed sockaddr if found, NULL otherwise
+ * Return: the new bind for the passed sockaddr, an ERR_PTR() on failure
*/
struct ovpn_bind *ovpn_bind_from_sockaddr(const struct sockaddr_storage *ss)
{
diff --git a/drivers/net/ovpn/io.c b/drivers/net/ovpn/io.c
index 9526f8096da60..f14eb4e6c46ad 100644
--- a/drivers/net/ovpn/io.c
+++ b/drivers/net/ovpn/io.c
@@ -206,8 +206,7 @@ void ovpn_decrypt_post(void *data, int ret)
drop_nocount:
if (likely(ks))
ovpn_crypto_key_slot_put(ks);
- if (likely(peer))
- ovpn_peer_put(peer);
+ ovpn_peer_put(peer);
}
/* RX path entry point: decrypt packet and forward it to the device */
@@ -305,8 +304,7 @@ void ovpn_encrypt_post(void *data, int ret)
kfree_skb(skb);
if (likely(ks))
ovpn_crypto_key_slot_put(ks);
- if (likely(peer))
- ovpn_peer_put(peer);
+ ovpn_peer_put(peer);
}
static bool ovpn_encrypt_one(struct ovpn_peer *peer, struct sk_buff *skb)
diff --git a/drivers/net/ovpn/netlink.c b/drivers/net/ovpn/netlink.c
index 4dad852941982..aaca0612d6f4c 100644
--- a/drivers/net/ovpn/netlink.c
+++ b/drivers/net/ovpn/netlink.c
@@ -546,27 +546,15 @@ int ovpn_nl_peer_set_doit(struct sk_buff *skb, struct genl_info *info)
return 0;
}
-static int ovpn_nl_send_peer(struct sk_buff *skb, const struct genl_info *info,
- const struct ovpn_peer *peer, u32 portid, u32 seq,
- int flags)
+static int ovpn_nl_fill_peer(struct sk_buff *skb, const struct genl_info *info,
+ const struct ovpn_peer *peer)
{
const struct ovpn_bind *bind;
struct ovpn_socket *sock;
int ret = -EMSGSIZE;
- struct nlattr *attr;
__be16 local_port;
- void *hdr;
int id;
- hdr = genlmsg_put(skb, portid, seq, &ovpn_nl_family, flags,
- OVPN_CMD_PEER_GET);
- if (!hdr)
- return -ENOBUFS;
-
- attr = nla_nest_start(skb, OVPN_A_PEER);
- if (!attr)
- goto err;
-
rcu_read_lock();
sock = rcu_dereference(peer->sock);
if (!sock) {
@@ -574,7 +562,7 @@ static int ovpn_nl_send_peer(struct sk_buff *skb, const struct genl_info *info,
goto err_unlock;
}
- if (!net_eq(genl_info_net(info), sock_net(sock->sk))) {
+ if (info && !net_eq(genl_info_net(info), sock_net(sock->sk))) {
id = peernet2id_alloc(genl_info_net(info),
sock_net(sock->sk),
GFP_ATOMIC);
@@ -585,26 +573,26 @@ static int ovpn_nl_send_peer(struct sk_buff *skb, const struct genl_info *info,
rcu_read_unlock();
if (nla_put_u32(skb, OVPN_A_PEER_ID, peer->id))
- goto err;
+ return -EMSGSIZE;
if (nla_put_u32(skb, OVPN_A_PEER_TX_ID, peer->tx_id))
- goto err;
+ return -EMSGSIZE;
if (peer->vpn_addrs.ipv4.s_addr != htonl(INADDR_ANY))
if (nla_put_in_addr(skb, OVPN_A_PEER_VPN_IPV4,
peer->vpn_addrs.ipv4.s_addr))
- goto err;
+ return -EMSGSIZE;
if (!ipv6_addr_equal(&peer->vpn_addrs.ipv6, &in6addr_any))
if (nla_put_in6_addr(skb, OVPN_A_PEER_VPN_IPV6,
&peer->vpn_addrs.ipv6))
- goto err;
+ return -EMSGSIZE;
if (nla_put_u32(skb, OVPN_A_PEER_KEEPALIVE_INTERVAL,
peer->keepalive_interval) ||
nla_put_u32(skb, OVPN_A_PEER_KEEPALIVE_TIMEOUT,
peer->keepalive_timeout))
- goto err;
+ return -EMSGSIZE;
rcu_read_lock();
bind = rcu_dereference(peer->bind);
@@ -652,14 +640,39 @@ static int ovpn_nl_send_peer(struct sk_buff *skb, const struct genl_info *info,
atomic64_read(&peer->link_stats.tx.bytes)) ||
nla_put_uint(skb, OVPN_A_PEER_LINK_TX_PACKETS,
atomic64_read(&peer->link_stats.tx.packets)))
+ return -EMSGSIZE;
+
+ return 0;
+err_unlock:
+ rcu_read_unlock();
+ return ret;
+}
+
+static int ovpn_nl_send_peer(struct sk_buff *skb, const struct genl_info *info,
+ const struct ovpn_peer *peer, u32 portid, u32 seq,
+ int flags)
+{
+ struct nlattr *attr;
+ int ret = -EMSGSIZE;
+ void *hdr;
+
+ hdr = genlmsg_put(skb, portid, seq, &ovpn_nl_family, flags,
+ OVPN_CMD_PEER_GET);
+ if (!hdr)
+ return -ENOBUFS;
+
+ attr = nla_nest_start(skb, OVPN_A_PEER);
+ if (!attr)
+ goto err;
+
+ ret = ovpn_nl_fill_peer(skb, info, peer);
+ if (ret < 0)
goto err;
nla_nest_end(skb, attr);
genlmsg_end(skb, hdr);
return 0;
-err_unlock:
- rcu_read_unlock();
err:
genlmsg_cancel(skb, hdr);
return ret;
@@ -1193,7 +1206,8 @@ int ovpn_nl_peer_del_notify(struct ovpn_peer *peer)
if (nla_put_u32(msg, OVPN_A_PEER_DEL_REASON, peer->delete_reason))
goto err_cancel_msg;
- if (nla_put_u32(msg, OVPN_A_PEER_ID, peer->id))
+ ret = ovpn_nl_fill_peer(msg, NULL, peer);
+ if (ret < 0)
goto err_cancel_msg;
nla_nest_end(msg, attr);
diff --git a/drivers/net/ovpn/socket.h b/drivers/net/ovpn/socket.h
index 4afcec71040d9..5c87392ecd304 100644
--- a/drivers/net/ovpn/socket.h
+++ b/drivers/net/ovpn/socket.h
@@ -24,7 +24,6 @@ struct ovpn_peer;
* @peer: unique peer transmitting over this socket (TCP only)
* @sk: the low level sock object
* @refcount: amount of contexts currently referencing this object
- * @work: member used to schedule release routine (it may block)
* @tcp_tx_work: work for deferring outgoing packet processing (TCP only)
*/
struct ovpn_socket {
@@ -38,7 +37,6 @@ struct ovpn_socket {
struct sock *sk;
struct kref refcount;
- struct work_struct work;
struct work_struct tcp_tx_work;
};
diff --git a/tools/testing/selftests/net/ovpn/common.sh b/tools/testing/selftests/net/ovpn/common.sh
index 2d844eb3aa6e3..611d528c7de88 100644
--- a/tools/testing/selftests/net/ovpn/common.sh
+++ b/tools/testing/selftests/net/ovpn/common.sh
@@ -19,9 +19,42 @@ OVPN_VERBOSE=${OVPN_VERBOSE:-0}
export OVPN_ID_OFFSET=$(( 9 * (OVPN_SYMMETRIC_ID == 0) ))
-OVPN_JQ_FILTER='map(if type == "array" then .[] else . end) |
- map(select(.msg.peer | has("remote-ipv6") | not)) |
- map(del(.msg.ifindex)) | sort_by(.msg.peer.id)[]'
+# Peer delete notifications include traffic counters whose values depend on
+# timing. zero_attr() sets a counter to zero only when that counter is present,
+# so missing stats still fail the comparison. zero_peer_stats is just the list
+# of counters to normalize. normalize_peer_del_ntf applies that to peer-del-ntf
+# messages and drops transport endpoint details, while leaving other
+# notifications unchanged.
+OVPN_JQ_FILTER='
+ def zero_attr(key):
+ if has(key) then .[key] = 0 else . end;
+
+ def zero_peer_stats:
+ zero_attr("vpn-rx-bytes") |
+ zero_attr("vpn-rx-packets") |
+ zero_attr("vpn-tx-bytes") |
+ zero_attr("vpn-tx-packets") |
+ zero_attr("link-rx-bytes") |
+ zero_attr("link-rx-packets") |
+ zero_attr("link-tx-bytes") |
+ zero_attr("link-tx-packets");
+
+ def normalize_peer_del_ntf:
+ if .name == "peer-del-ntf" then
+ .msg.peer |= (
+ del(.["remote-ipv4"], .["remote-ipv6"],
+ .["remote-ipv6-scope-id"], .["remote-port"],
+ .["local-ipv4"], .["local-ipv6"],
+ .["local-port"]) |
+ zero_peer_stats
+ )
+ else . end;
+
+ map(if type == "array" then .[] else . end) |
+ map(del(.msg.ifindex)) |
+ map(normalize_peer_del_ntf) |
+ sort_by(.msg.peer.id)[]'
+
OVPN_LAN_IP="11.11.11.11"
declare -A OVPN_TMP_JSONS=()
@@ -178,20 +211,14 @@ ovpn_setup_ns() {
ovpn_build_capture_filter() {
# match the first four bytes of the openvpn data payload
- if [ "${OVPN_PROTO}" == "UDP" ]; then
- # For UDP, libpcap transport indexing only works for IPv4, so
- # use an explicit IPv4 or IPv6 expression based on the peer
- # address. The IPv6 branch assumes there are no extension
- # headers in the outer packet.
- if [[ "${2}" == *:* ]]; then
- printf "ip6 and ip6[6] = 17 and ip6[48:4] = %s" "${1}"
- else
- printf "ip and udp[8:4] = %s" "${1}"
- fi
+ # For UDP, libpcap transport indexing only works for IPv4, so
+ # use an explicit IPv4 or IPv6 expression based on the peer
+ # address. The IPv6 branch assumes there are no extension
+ # headers in the outer packet.
+ if [[ "${2}" == *:* ]]; then
+ printf "ip6 and ip6[6] = 17 and ip6[48:4] = %s" "${1}"
else
- # openvpn over TCP prepends a 2-byte packet length ahead of the
- # DATA_V2 opcode, so skip it before matching the payload header
- printf "ip and tcp[(((tcp[12] & 0xf0) >> 2) + 2):4] = %s" "${1}"
+ printf "ip and udp[8:4] = %s" "${1}"
fi
}
diff --git a/tools/testing/selftests/net/ovpn/json/peer0-float.json b/tools/testing/selftests/net/ovpn/json/peer0-float.json
index 682fa58ad4ea8..9711f2cf9cf60 100644
--- a/tools/testing/selftests/net/ovpn/json/peer0-float.json
+++ b/tools/testing/selftests/net/ovpn/json/peer0-float.json
@@ -1,9 +1,9 @@
{"name": "peer-float-ntf", "msg": {"ifindex": 0, "peer": {"id": 1, "remote-ipv4": "10.10.1.3", "remote-port": 1}}}
{"name": "peer-float-ntf", "msg": {"ifindex": 0, "peer": {"id": 2, "remote-ipv4": "10.10.2.3", "remote-port": 1}}}
{"name": "peer-float-ntf", "msg": {"ifindex": 0, "peer": {"id": 3, "remote-ipv4": "10.10.3.3", "remote-port": 1}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 1}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 2}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 3}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 4}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 5}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 6}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 1, "tx-id": 10, "vpn-ipv4": "5.5.5.2", "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 2, "tx-id": 11, "vpn-ipv4": "5.5.5.3", "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 3, "tx-id": 12, "vpn-ipv4": "5.5.5.4", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 4, "tx-id": 13, "vpn-ipv4": "5.5.5.5", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 5, "tx-id": 14, "vpn-ipv4": "5.5.5.6", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 6, "tx-id": 15, "vpn-ipv4": "5.5.5.7", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer0-symm-float.json b/tools/testing/selftests/net/ovpn/json/peer0-symm-float.json
deleted file mode 120000
index e31a5bd598638..0000000000000
--- a/tools/testing/selftests/net/ovpn/json/peer0-symm-float.json
+++ /dev/null
@@ -1 +0,0 @@
-peer0-float.json
\ No newline at end of file
diff --git a/tools/testing/selftests/net/ovpn/json/peer0-symm-float.json b/tools/testing/selftests/net/ovpn/json/peer0-symm-float.json
new file mode 100644
index 0000000000000..c94dcc81c80e8
--- /dev/null
+++ b/tools/testing/selftests/net/ovpn/json/peer0-symm-float.json
@@ -0,0 +1,9 @@
+{"name": "peer-float-ntf", "msg": {"ifindex": 0, "peer": {"id": 1, "remote-ipv4": "10.10.1.3", "remote-port": 1}}}
+{"name": "peer-float-ntf", "msg": {"ifindex": 0, "peer": {"id": 2, "remote-ipv4": "10.10.2.3", "remote-port": 1}}}
+{"name": "peer-float-ntf", "msg": {"ifindex": 0, "peer": {"id": 3, "remote-ipv4": "10.10.3.3", "remote-port": 1}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 1, "tx-id": 1, "vpn-ipv4": "5.5.5.2", "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 2, "tx-id": 2, "vpn-ipv4": "5.5.5.3", "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 3, "tx-id": 3, "vpn-ipv4": "5.5.5.4", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 4, "tx-id": 4, "vpn-ipv4": "5.5.5.5", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 5, "tx-id": 5, "vpn-ipv4": "5.5.5.6", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 6, "tx-id": 6, "vpn-ipv4": "5.5.5.7", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer0-symm.json b/tools/testing/selftests/net/ovpn/json/peer0-symm.json
deleted file mode 120000
index 57a163048eeda..0000000000000
--- a/tools/testing/selftests/net/ovpn/json/peer0-symm.json
+++ /dev/null
@@ -1 +0,0 @@
-peer0.json
\ No newline at end of file
diff --git a/tools/testing/selftests/net/ovpn/json/peer0-symm.json b/tools/testing/selftests/net/ovpn/json/peer0-symm.json
new file mode 100644
index 0000000000000..2899913ea0643
--- /dev/null
+++ b/tools/testing/selftests/net/ovpn/json/peer0-symm.json
@@ -0,0 +1,6 @@
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 1, "tx-id": 1, "vpn-ipv4": "5.5.5.2", "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 2, "tx-id": 2, "vpn-ipv4": "5.5.5.3", "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 3, "tx-id": 3, "vpn-ipv4": "5.5.5.4", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 4, "tx-id": 4, "vpn-ipv4": "5.5.5.5", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 5, "tx-id": 5, "vpn-ipv4": "5.5.5.6", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 6, "tx-id": 6, "vpn-ipv4": "5.5.5.7", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer0.json b/tools/testing/selftests/net/ovpn/json/peer0.json
index 7c46a33d5ecdf..fff2a86b41ab8 100644
--- a/tools/testing/selftests/net/ovpn/json/peer0.json
+++ b/tools/testing/selftests/net/ovpn/json/peer0.json
@@ -1,6 +1,6 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 1}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 2}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 3}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 4}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 5}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 6}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 1, "tx-id": 10, "vpn-ipv4": "5.5.5.2", "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 2, "tx-id": 11, "vpn-ipv4": "5.5.5.3", "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 3, "tx-id": 12, "vpn-ipv4": "5.5.5.4", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 4, "tx-id": 13, "vpn-ipv4": "5.5.5.5", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 5, "tx-id": 14, "vpn-ipv4": "5.5.5.6", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 6, "tx-id": 15, "vpn-ipv4": "5.5.5.7", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer1-symm.json b/tools/testing/selftests/net/ovpn/json/peer1-symm.json
index 5da4ea9d51fb3..41b358e1be51c 100644
--- a/tools/testing/selftests/net/ovpn/json/peer1-symm.json
+++ b/tools/testing/selftests/net/ovpn/json/peer1-symm.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 1}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 1, "tx-id": 1, "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer1.json b/tools/testing/selftests/net/ovpn/json/peer1.json
index 1009d26dc14a2..6332709d2a88e 100644
--- a/tools/testing/selftests/net/ovpn/json/peer1.json
+++ b/tools/testing/selftests/net/ovpn/json/peer1.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 10}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 10, "tx-id": 1, "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer2-symm.json b/tools/testing/selftests/net/ovpn/json/peer2-symm.json
index 8f6db4f8c2ac4..b1840bf979e8f 100644
--- a/tools/testing/selftests/net/ovpn/json/peer2-symm.json
+++ b/tools/testing/selftests/net/ovpn/json/peer2-symm.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 2}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 2, "tx-id": 2, "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer2.json b/tools/testing/selftests/net/ovpn/json/peer2.json
index 44e9fad2b6221..431427e4eb53b 100644
--- a/tools/testing/selftests/net/ovpn/json/peer2.json
+++ b/tools/testing/selftests/net/ovpn/json/peer2.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 11}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 11, "tx-id": 2, "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer3-symm.json b/tools/testing/selftests/net/ovpn/json/peer3-symm.json
index bdabd6fa2e647..f9ab2a15dd9fd 100644
--- a/tools/testing/selftests/net/ovpn/json/peer3-symm.json
+++ b/tools/testing/selftests/net/ovpn/json/peer3-symm.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 3}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 3, "tx-id": 3, "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer3.json b/tools/testing/selftests/net/ovpn/json/peer3.json
index d4be8ba130ae3..4f9522a664ee4 100644
--- a/tools/testing/selftests/net/ovpn/json/peer3.json
+++ b/tools/testing/selftests/net/ovpn/json/peer3.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 12}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 12, "tx-id": 3, "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer4-symm.json b/tools/testing/selftests/net/ovpn/json/peer4-symm.json
index c3734bb9251b0..b41ab838a304f 100644
--- a/tools/testing/selftests/net/ovpn/json/peer4-symm.json
+++ b/tools/testing/selftests/net/ovpn/json/peer4-symm.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 4}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 4, "tx-id": 4, "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer4.json b/tools/testing/selftests/net/ovpn/json/peer4.json
index 67d27e2d48ac9..7d6b3c8af0e46 100644
--- a/tools/testing/selftests/net/ovpn/json/peer4.json
+++ b/tools/testing/selftests/net/ovpn/json/peer4.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 13}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 13, "tx-id": 4, "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer5-symm.json b/tools/testing/selftests/net/ovpn/json/peer5-symm.json
index 46c4a348299d6..962def1ec16f3 100644
--- a/tools/testing/selftests/net/ovpn/json/peer5-symm.json
+++ b/tools/testing/selftests/net/ovpn/json/peer5-symm.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 5}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 5, "tx-id": 5, "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer5.json b/tools/testing/selftests/net/ovpn/json/peer5.json
index ecd9bd0b2f371..963dc74cdaa60 100644
--- a/tools/testing/selftests/net/ovpn/json/peer5.json
+++ b/tools/testing/selftests/net/ovpn/json/peer5.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 14}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 14, "tx-id": 5, "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer6-symm.json b/tools/testing/selftests/net/ovpn/json/peer6-symm.json
index aa30f2cff625b..3ff352fae60fb 100644
--- a/tools/testing/selftests/net/ovpn/json/peer6-symm.json
+++ b/tools/testing/selftests/net/ovpn/json/peer6-symm.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 6}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 6, "tx-id": 6, "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer6.json b/tools/testing/selftests/net/ovpn/json/peer6.json
index 7fded29c58043..0db187f3af189 100644
--- a/tools/testing/selftests/net/ovpn/json/peer6.json
+++ b/tools/testing/selftests/net/ovpn/json/peer6.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 15}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 15, "tx-id": 6, "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/ovpn-cli.c b/tools/testing/selftests/net/ovpn/ovpn-cli.c
index f4effa7580c0f..6b458a654a337 100644
--- a/tools/testing/selftests/net/ovpn/ovpn-cli.c
+++ b/tools/testing/selftests/net/ovpn/ovpn-cli.c
@@ -470,6 +470,18 @@ static int ovpn_parse_key_direction(const char *dir, struct ovpn_ctx *ctx)
return 0;
}
+static int ovpn_tcp_nodelay(int socket)
+{
+ int opt = 1;
+ int ret;
+
+ ret = setsockopt(socket, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
+ if (ret < 0)
+ perror("setsockopt for TCP_NODELAY");
+
+ return ret;
+}
+
static int ovpn_socket(struct ovpn_ctx *ctx, sa_family_t family, int proto)
{
struct sockaddr_storage local_sock = { 0 };
@@ -606,6 +618,12 @@ static int ovpn_accept(struct ovpn_ctx *ctx)
goto err;
}
+ if (ovpn_tcp_nodelay(ret) < 0) {
+ close(ret);
+ ret = -1;
+ goto err;
+ }
+
return ret;
err:
close(ctx->socket);
@@ -623,6 +641,10 @@ static int ovpn_connect(struct ovpn_ctx *ovpn)
return -1;
}
+ ret = ovpn_tcp_nodelay(s);
+ if (ret < 0)
+ goto err;
+
switch (ovpn->remote.in4.sin_family) {
case AF_INET:
socklen = sizeof(struct sockaddr_in);
diff --git a/tools/testing/selftests/net/ovpn/test.sh b/tools/testing/selftests/net/ovpn/test.sh
index 9b5610837032f..d744c1a97d5fc 100755
--- a/tools/testing/selftests/net/ovpn/test.sh
+++ b/tools/testing/selftests/net/ovpn/test.sh
@@ -67,35 +67,33 @@ ovpn_run_basic_traffic() {
local tcpdump_timeout="1.5s"
for p in $(seq 1 ${OVPN_NUM_PEERS}); do
- # The first part of the data packet header consists of:
- # - TCP only: 2 bytes for the packet length
- # - 5 bits for opcode ("9" for DATA_V2)
- # - 3 bits for key-id ("0" at this point)
- # - 12 bytes for peer-id:
- # - with asymmetric ID: "${p}" one way and "${p} + 9" the
- # other way
- # - with symmetric ID: "${p}" both ways
- header1=$(printf "0x4800000%x" ${p})
- header2=$(printf "0x4800000%x" $((p + OVPN_ID_OFFSET)))
- raddr=""
if [ "${OVPN_PROTO}" == "UDP" ]; then
+ # The first part of the data packet header consists of:
+ # - 5 bits for opcode ("9" for DATA_V2)
+ # - 3 bits for key-id ("0" at this point)
+ # - 3 bytes for peer-id:
+ # - with asymmetric ID: "${p}" one way and "${p} + 9" the
+ # other way
+ # - with symmetric ID: "${p}" both ways
+ header1=$(printf "0x4800000%x" ${p})
+ header2=$(printf "0x4800000%x" $((p + OVPN_ID_OFFSET)))
raddr=$(awk "NR == ${p} {print \$3}" \
"${OVPN_UDP_PEERS_FILE}")
+ peer_ns="ovpn_peer${p}"
+
+ timeout ${tcpdump_timeout} ip netns exec "${peer_ns}" \
+ tcpdump --immediate-mode -p -ni veth${p} -c 1 \
+ "$(ovpn_build_capture_filter "${header1}" "${raddr}")" \
+ >/dev/null 2>&1 &
+ tcpdump_pid1=$!
+ timeout ${tcpdump_timeout} ip netns exec "${peer_ns}" \
+ tcpdump --immediate-mode -p -ni veth${p} -c 1 \
+ "$(ovpn_build_capture_filter "${header2}" "${raddr}")" \
+ >/dev/null 2>&1 &
+ tcpdump_pid2=$!
+
+ sleep 0.3
fi
- peer_ns="ovpn_peer${p}"
-
- timeout ${tcpdump_timeout} ip netns exec "${peer_ns}" \
- tcpdump --immediate-mode -p -ni veth${p} -c 1 \
- "$(ovpn_build_capture_filter "${header1}" "${raddr}")" \
- >/dev/null 2>&1 &
- tcpdump_pid1=$!
- timeout ${tcpdump_timeout} ip netns exec "${peer_ns}" \
- tcpdump --immediate-mode -p -ni veth${p} -c 1 \
- "$(ovpn_build_capture_filter "${header2}" "${raddr}")" \
- >/dev/null 2>&1 &
- tcpdump_pid2=$!
-
- sleep 0.3
ovpn_cmd_ok "send baseline traffic to peer ${p}" \
ip netns exec ovpn_peer0 \
ping -qfc 100 -w 3 5.5.5.$((p + 1))
@@ -103,8 +101,10 @@ ovpn_run_basic_traffic() {
ip netns exec ovpn_peer0 \
ping -qfc 100 -s 3000 -w 3 5.5.5.$((p + 1))
- wait "${tcpdump_pid1}" || return 1
- wait "${tcpdump_pid2}" || return 1
+ if [ "${OVPN_PROTO}" == "UDP" ]; then
+ wait "${tcpdump_pid1}" || return 1
+ wait "${tcpdump_pid2}" || return 1
+ fi
done
}
|
| 3/2 | 2026/09/24 07:58 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 17576 output: 32 thoughts: 625 Thoughts: **Analyzing the Patch for Fuzzing Potential** Okay, let's break this patch down and see if it's worth our time to fuzz with syzkaller. First, I'm going to quickly scan the diff. The changes are mostly focused on the OpenVPN driver. I see some modifications in `drivers/net/ovpn/bind.c` but it appears to be a comment only, which I can ignore. The changes in `drivers/net/ovpn/io.c` are minor, just removing a `likely()` macro from an `if` statement when calling `ovpn_peer_put(peer)`. No immediate red flags there. However, things get more interesting in `drivers/net/ovpn/netlink.c`. I see that `ovpn_nl_send_peer` has been refactored into `ovpn_nl_fill_peer` and a new caller function, `ovpn_nl_send_peer`, which is fine, but look at `ovpn_nl_peer_del_notify`. Previously, it was directly putting two attributes into the netlink message, but now it calls `ovpn_nl_fill_peer(msg, NULL, peer)`. This is where I start to pay very close attention. The critical detail is that `ovpn_nl_fill_peer` checks `info` for a `net_eq` comparison, and *now* `info` is being passed as `NULL` in the deletion notification! The code looks like it is filling attributes for the peer being deleted in the netlink notification. I'm thinking, could this lead to a NULL pointer dereference in the logic that handles the deleted peer? I'm not entirely convinced that `ovpn_peer_put(peer)` is safe with a `NULL` peer pointer, so let's double check that. Finally, there are some minor updates to the selftests in `tools/testing/selftests/...`, which are less interesting at this stage. Also a `struct work_struct work;` has been removed from `struct ovpn_socket` in `drivers/net/ovpn/socket.h`. I'm leaning towards digging into the kernel code immediately. I'll probably use `grepper` or `read-file` to check that `ovpn_peer_put` handles NULL peers correctly. I'm also going to check if there are any race conditions that I can see regarding the peer deletion notification process and the potential for a `NULL` peer in that code path. |
| 4/2 | 2026/09/24 07:58 | tool | grepper |
0mArgs:{
"Expression": "ovpn_peer_put",
"PathPrefix": "drivers/net/ovpn"
}Results: {
"Output": "drivers/net/ovpn/io.c=108=void ovpn_decrypt_post(void *data, int ret)\n--\ndrivers/net/ovpn/io.c-208-\t\tovpn_crypto_key_slot_put(ks);\ndrivers/net/ovpn/io.c:209:\tovpn_peer_put(peer);\ndrivers/net/ovpn/io.c-210-}\n--\ndrivers/net/ovpn/io.c=213=void ovpn_recv(struct ovpn_peer *peer, struct sk_buff *skb)\n--\ndrivers/net/ovpn/io.c-228-\t\tkfree_skb(skb);\ndrivers/net/ovpn/io.c:229:\t\tovpn_peer_put(peer);\ndrivers/net/ovpn/io.c-230-\t\treturn;\n--\ndrivers/net/ovpn/io.c=237=void ovpn_encrypt_post(void *data, int ret)\n--\ndrivers/net/ovpn/io.c-306-\t\tovpn_crypto_key_slot_put(ks);\ndrivers/net/ovpn/io.c:307:\tovpn_peer_put(peer);\ndrivers/net/ovpn/io.c-308-}\n--\ndrivers/net/ovpn/io.c=334=static void ovpn_send(struct ovpn_priv *ovpn, struct sk_buff *skb,\n--\ndrivers/net/ovpn/io.c-348-\ndrivers/net/ovpn/io.c:349:\tovpn_peer_put(peer);\ndrivers/net/ovpn/io.c-350-}\n--\ndrivers/net/ovpn/io.c=354=netdev_tx_t ovpn_net_xmit(struct sk_buff *skb, struct net_device *dev)\n--\ndrivers/net/ovpn/io.c-427-\tif (unlikely(skb_queue_empty(\u0026skb_list))) {\ndrivers/net/ovpn/io.c:428:\t\tovpn_peer_put(peer);\ndrivers/net/ovpn/io.c-429-\t\treturn NETDEV_TX_OK;\n--\ndrivers/net/ovpn/io.c-438-drop:\ndrivers/net/ovpn/io.c:439:\tovpn_peer_put(peer);\ndrivers/net/ovpn/io.c-440-drop_no_peer:\n--\ndrivers/net/ovpn/io.c=456=void ovpn_xmit_special(struct ovpn_peer *peer, const void *data,\n--\ndrivers/net/ovpn/io.c-463-\tif (unlikely(!ovpn)) {\ndrivers/net/ovpn/io.c:464:\t\tovpn_peer_put(peer);\ndrivers/net/ovpn/io.c-465-\t\treturn;\n--\ndrivers/net/ovpn/io.c-469-\tif (unlikely(!skb)) {\ndrivers/net/ovpn/io.c:470:\t\tovpn_peer_put(peer);\ndrivers/net/ovpn/io.c-471-\t\treturn;\n--\ndrivers/net/ovpn/netlink.c=347=int ovpn_nl_peer_new_doit(struct sk_buff *skb, struct genl_info *info)\n--\ndrivers/net/ovpn/netlink.c-469-\t */\ndrivers/net/ovpn/netlink.c:470:\tovpn_peer_put(peer);\ndrivers/net/ovpn/netlink.c-471-\n--\ndrivers/net/ovpn/netlink.c=475=int ovpn_nl_peer_set_doit(struct sk_buff *skb, struct genl_info *info)\n--\ndrivers/net/ovpn/netlink.c-518-\t\t\t\t \"unexpected remote IP address with TCP socket\");\ndrivers/net/ovpn/netlink.c:519:\t\tovpn_peer_put(peer);\ndrivers/net/ovpn/netlink.c-520-\t\treturn -EINVAL;\n--\ndrivers/net/ovpn/netlink.c-527-\t\tspin_unlock_bh(\u0026ovpn-\u003elock);\ndrivers/net/ovpn/netlink.c:528:\t\tovpn_peer_put(peer);\ndrivers/net/ovpn/netlink.c-529-\t\treturn ret;\n--\ndrivers/net/ovpn/netlink.c-543-\tspin_unlock_bh(\u0026ovpn-\u003elock);\ndrivers/net/ovpn/netlink.c:544:\tovpn_peer_put(peer);\ndrivers/net/ovpn/netlink.c-545-\n--\ndrivers/net/ovpn/netlink.c=681=int ovpn_nl_peer_get_doit(struct sk_buff *skb, struct genl_info *info)\n--\ndrivers/net/ovpn/netlink.c-741-err:\ndrivers/net/ovpn/netlink.c:742:\tovpn_peer_put(peer);\ndrivers/net/ovpn/netlink.c-743-\treturn ret;\n--\ndrivers/net/ovpn/netlink.c=807=int ovpn_nl_peer_del_doit(struct sk_buff *skb, struct genl_info *info)\n--\ndrivers/net/ovpn/netlink.c-836-\tret = ovpn_peer_del(peer, OVPN_DEL_PEER_REASON_USERSPACE);\ndrivers/net/ovpn/netlink.c:837:\tovpn_peer_put(peer);\ndrivers/net/ovpn/netlink.c-838-\n--\ndrivers/net/ovpn/netlink.c=906=int ovpn_nl_key_new_doit(struct sk_buff *skb, struct genl_info *info)\n--\ndrivers/net/ovpn/netlink.c-973-out:\ndrivers/net/ovpn/netlink.c:974:\tovpn_peer_put(peer);\ndrivers/net/ovpn/netlink.c-975-\treturn ret;\n--\ndrivers/net/ovpn/netlink.c=1011=int ovpn_nl_key_get_doit(struct sk_buff *skb, struct genl_info *info)\n--\ndrivers/net/ovpn/netlink.c-1088-err:\ndrivers/net/ovpn/netlink.c:1089:\tovpn_peer_put(peer);\ndrivers/net/ovpn/netlink.c-1090-\treturn ret;\n--\ndrivers/net/ovpn/netlink.c=1093=int ovpn_nl_key_swap_doit(struct sk_buff *skb, struct genl_info *info)\n--\ndrivers/net/ovpn/netlink.c-1123-\tovpn_crypto_key_slots_swap(\u0026peer-\u003ecrypto);\ndrivers/net/ovpn/netlink.c:1124:\tovpn_peer_put(peer);\ndrivers/net/ovpn/netlink.c-1125-\n--\ndrivers/net/ovpn/netlink.c=1129=int ovpn_nl_key_del_doit(struct sk_buff *skb, struct genl_info *info)\n--\ndrivers/net/ovpn/netlink.c-1166-\tovpn_crypto_key_slot_delete(\u0026peer-\u003ecrypto, slot);\ndrivers/net/ovpn/netlink.c:1167:\tovpn_peer_put(peer);\ndrivers/net/ovpn/netlink.c-1168-\n--\ndrivers/net/ovpn/peer.c=25=static void unlock_ovpn(struct ovpn_priv *ovpn,\n--\ndrivers/net/ovpn/peer.c-35-\t\tovpn_socket_release(peer);\ndrivers/net/ovpn/peer.c:36:\t\tovpn_peer_put(peer);\ndrivers/net/ovpn/peer.c-37-\t}\n--\ndrivers/net/ovpn/peer.c=1021=static int ovpn_peer_add_mp(struct ovpn_priv *ovpn, struct ovpn_peer *peer)\n--\ndrivers/net/ovpn/peer.c-1035-\tif (tmp) {\ndrivers/net/ovpn/peer.c:1036:\t\tovpn_peer_put(tmp);\ndrivers/net/ovpn/peer.c-1037-\t\tret = -EEXIST;\n--\ndrivers/net/ovpn/peer.c=1155=static int ovpn_peer_del_mp(struct ovpn_peer *peer,\n--\ndrivers/net/ovpn/peer.c-1170-\tif (tmp)\ndrivers/net/ovpn/peer.c:1171:\t\tovpn_peer_put(tmp);\ndrivers/net/ovpn/peer.c-1172-\n--\ndrivers/net/ovpn/peer.c=1312=static time64_t ovpn_peer_keepalive_work_single(struct ovpn_peer *peer,\n--\ndrivers/net/ovpn/peer.c-1374-\t\tif (!queue_work(ovpn_wq, \u0026peer-\u003ekeepalive_work))\ndrivers/net/ovpn/peer.c:1375:\t\t\tovpn_peer_put(peer);\ndrivers/net/ovpn/peer.c-1376-\t}\n--\ndrivers/net/ovpn/peer.h=130=void ovpn_peer_release_kref(struct kref *kref);\n--\ndrivers/net/ovpn/peer.h-132-/**\ndrivers/net/ovpn/peer.h:133: * ovpn_peer_put - decrease reference counter\ndrivers/net/ovpn/peer.h-134- * @peer: the peer whose counter should be decreased\ndrivers/net/ovpn/peer.h-135- */\ndrivers/net/ovpn/peer.h:136:static inline void ovpn_peer_put(struct ovpn_peer *peer)\ndrivers/net/ovpn/peer.h-137-{\n--\ndrivers/net/ovpn/socket.c=66=void ovpn_socket_release(struct ovpn_peer *peer)\n--\ndrivers/net/ovpn/socket.c-98-\t\t\tovpn_tcp_socket_wait_finish(sock);\ndrivers/net/ovpn/socket.c:99:\t\t\tovpn_peer_put(sock-\u003epeer);\ndrivers/net/ovpn/socket.c-100-\t\t}\n--\ndrivers/net/ovpn/socket.c=134=struct ovpn_socket *ovpn_socket_new(struct socket *sock, struct ovpn_peer *peer)\n--\ndrivers/net/ovpn/socket.c-240-\t\tif (sk-\u003esk_protocol == IPPROTO_TCP)\ndrivers/net/ovpn/socket.c:241:\t\t\tovpn_peer_put(peer);\ndrivers/net/ovpn/socket.c-242-\t\telse if (sk-\u003esk_protocol == IPPROTO_UDP)\n--\ndrivers/net/ovpn/tcp.c=102=static void ovpn_tcp_rcv(struct strparser *strp, struct sk_buff *skb)\n--\ndrivers/net/ovpn/tcp.c-154-\tif (!queue_work(ovpn_wq, \u0026peer-\u003etcp.defer_del_work))\ndrivers/net/ovpn/tcp.c:155:\t\tovpn_peer_put(peer);\ndrivers/net/ovpn/tcp.c-156-\tovpn_dev_dstats_rx_dropped(peer-\u003eovpn-\u003edev);\n--\ndrivers/net/ovpn/tcp.c=161=static int ovpn_tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,\n--\ndrivers/net/ovpn/tcp.c-205-out:\ndrivers/net/ovpn/tcp.c:206:\tovpn_peer_put(peer);\ndrivers/net/ovpn/tcp.c-207-\treturn ret;\n--\ndrivers/net/ovpn/tcp.c=256=static void ovpn_tcp_send_sock(struct ovpn_peer *peer, struct sock *sk)\n--\ndrivers/net/ovpn/tcp.c-287-\t\t\tif (!queue_work(ovpn_wq, \u0026peer-\u003etcp.defer_del_work))\ndrivers/net/ovpn/tcp.c:288:\t\t\t\tovpn_peer_put(peer);\ndrivers/net/ovpn/tcp.c-289-\n--\ndrivers/net/ovpn/tcp.c=369=static void ovpn_tcp_release(struct sock *sk)\n--\ndrivers/net/ovpn/tcp.c-400-\tpeer-\u003etcp.sk_cb.prot-\u003erelease_cb(sk);\ndrivers/net/ovpn/tcp.c:401:\tovpn_peer_put(peer);\ndrivers/net/ovpn/tcp.c-402-}\n--\ndrivers/net/ovpn/tcp.c=404=static int ovpn_tcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)\n--\ndrivers/net/ovpn/tcp.c-459-\trelease_sock(sk);\ndrivers/net/ovpn/tcp.c:460:\tovpn_peer_put(peer);\ndrivers/net/ovpn/tcp.c-461-\treturn ret;\n--\ndrivers/net/ovpn/tcp.c=500=static void ovpn_tcp_peer_del_work(struct work_struct *work)\n--\ndrivers/net/ovpn/tcp.c-505-\tovpn_peer_del(peer, OVPN_DEL_PEER_REASON_TRANSPORT_ERROR);\ndrivers/net/ovpn/tcp.c:506:\tovpn_peer_put(peer);\ndrivers/net/ovpn/tcp.c-507-}\n--\ndrivers/net/ovpn/tcp.c=578=static void ovpn_tcp_close(struct sock *sk, long timeout)\n--\ndrivers/net/ovpn/tcp.c-598-\tpeer-\u003etcp.sk_cb.prot-\u003eclose(sk, timeout);\ndrivers/net/ovpn/tcp.c:599:\tovpn_peer_put(peer);\ndrivers/net/ovpn/tcp.c-600-}\n--\ndrivers/net/ovpn/tcp.c=602=static __poll_t ovpn_tcp_poll(struct file *file, struct socket *sock,\n--\ndrivers/net/ovpn/tcp.c-630-\tif (peer)\ndrivers/net/ovpn/tcp.c:631:\t\tovpn_peer_put(peer);\ndrivers/net/ovpn/tcp.c-632-\n"
} |
| 5/2 | 2026/09/24 07:58 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 22582 output: 38 thoughts: 25 Thoughts: Okay, let's dive into this. Here's my take on examining that function: **Inspecting `ovpn_peer_put`** Right, so I need to understand how the OpenVPN driver manages its peers. The documentation points to `ovpn_peer_put`, specifically in `drivers/net/ovpn/peer.h`. I'm guessing this function is central to deallocating or releasing a peer's resources. Given the "put" naming convention, it likely handles the decrement of a reference count or some other form of resource management. I'll need to look at its definition and any callers to get the complete picture. Things I'll immediately be looking for: what structures it operates on, any locking primitives involved, potential error handling, and most importantly, where and when this function gets *called* to understand the lifetime management of a peer. I'll need to keep an eye out for potential use-after-free scenarios if the reference counting is incorrect, and deadlocks if there are any locking issues. Gotta make sure this crucial function is thread-safe and robust! |
| 6/2 | 2026/09/24 07:58 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/peer.h",
"FirstLine": 130,
"LineCount": 20
}Results: {
"Contents": " 130:\tvoid ovpn_peer_release_kref(struct kref *kref);\n 131:\t\n 132:\t/**\n 133:\t * ovpn_peer_put - decrease reference counter\n 134:\t * @peer: the peer whose counter should be decreased\n 135:\t */\n 136:\tstatic inline void ovpn_peer_put(struct ovpn_peer *peer)\n 137:\t{\n 138:\t\tkref_put(\u0026peer-\u003erefcount, ovpn_peer_release_kref);\n 139:\t}\n 140:\t\n 141:\tstruct ovpn_peer *ovpn_peer_new(struct ovpn_priv *ovpn, u32 id);\n 142:\tint ovpn_peer_add(struct ovpn_priv *ovpn, struct ovpn_peer *peer);\n 143:\tint ovpn_peer_del(struct ovpn_peer *peer, enum ovpn_del_peer_reason reason);\n 144:\tvoid ovpn_peers_free(struct ovpn_priv *ovpn, struct sock *sock,\n 145:\t\t\t enum ovpn_del_peer_reason reason);\n 146:\t\n 147:\tstruct ovpn_peer *ovpn_peer_get_by_transp_addr(struct ovpn_priv *ovpn,\n 148:\t\t\t\t\t\t struct sk_buff *skb);\n 149:\tstruct ovpn_peer *ovpn_peer_get_by_id(struct ovpn_priv *ovpn, u32 peer_id);\n"
} |
| 7/2 | 2026/09/24 07:58 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 23296 output: 38 thoughts: 72 Thoughts: Here's my summary, as I see it: **Digging into the OpenVPN Driver's Encryption/Decryption** Okay, hold on a second. I need to take a closer look at the OpenVPN driver, specifically the encryption and decryption processes. I need to see what's happening internally. My attention is drawn to `ovpn_decrypt_post` and `ovpn_encrypt_post` within `drivers/net/ovpn/io.c`. Let's drill down into that file. I'm going to focus my initial analysis on lines roughly between 100 and 220, and then also between 230 and 310. That should give me a good understanding of the data flow and how the key operations are performed. Gotta understand the core building blocks first, before assessing potential performance impacts or security vulnerabilities. |
| 8/2 | 2026/09/24 07:58 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/io.c",
"FirstLine": 195,
"LineCount": 30
}Results: {
"Contents": " 195:\t\t\t\t\t\t peer-\u003eid, \u0026ip_hdr(skb)-\u003esaddr);\n 196:\t\t\tgoto drop;\n 197:\t\t}\n 198:\t\n 199:\t\tovpn_netdev_write(peer, skb);\n 200:\t\t/* skb is passed to upper layer - don't free it */\n 201:\t\tskb = NULL;\n 202:\tdrop:\n 203:\t\tif (unlikely(skb))\n 204:\t\t\tovpn_dev_dstats_rx_dropped(peer-\u003eovpn-\u003edev);\n 205:\t\tkfree_skb(skb);\n 206:\tdrop_nocount:\n 207:\t\tif (likely(ks))\n 208:\t\t\tovpn_crypto_key_slot_put(ks);\n 209:\t\tovpn_peer_put(peer);\n 210:\t}\n 211:\t\n 212:\t/* RX path entry point: decrypt packet and forward it to the device */\n 213:\tvoid ovpn_recv(struct ovpn_peer *peer, struct sk_buff *skb)\n 214:\t{\n 215:\t\tstruct ovpn_crypto_key_slot *ks;\n 216:\t\tu8 key_id;\n 217:\t\n 218:\t\tovpn_peer_stats_increment_rx(\u0026peer-\u003elink_stats, skb-\u003elen);\n 219:\t\n 220:\t\t/* get the key slot matching the key ID in the received packet */\n 221:\t\tkey_id = ovpn_key_id_from_skb(skb);\n 222:\t\tks = ovpn_crypto_key_id_to_slot(\u0026peer-\u003ecrypto, key_id);\n 223:\t\tif (unlikely(!ks)) {\n 224:\t\t\tnet_info_ratelimited(\"%s: no available key for peer %u, key-id: %u\\n\",\n"
} |
| 9/2 | 2026/09/24 07:58 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 24106 output: 38 thoughts: 24 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience: **Analyzing Encryption Post-Processing Functions** Alright, let's dive right in. My initial focus is on the crucial post-processing steps following decryption and encryption, specifically within the `ovpn_decrypt_post` and `ovpn_encrypt_post` functions. I want to establish a solid understanding of how these functions handle the data after the core cryptographic operations. I need to quickly determine: * What are the primary roles of each function? Is it primarily integrity checks? Data format verification? Or something else? * Are there opportunities for optimization or potential vulnerabilities related to data handling after the core crypto process? Is there any redundant processing? Are there any obvious areas for fuzzing, or where subtle data manipulation could bypass controls? * How do these functions integrate into the larger OpenVPN architecture? Are they part of a critical path, and what impact do they have on performance? Understanding this will require a look at the data flow within the overall system. * Are there areas where there is shared or duplicated code? This could be an area for simplification and error mitigation. * How is error handling implemented in each case? Are exceptions caught? How are they handled? I will need to understand what's in place. * Do the functions have a potential to introduce a denial of service vulnerability? This is where I'll be starting. Let's dig in and see what we can find. |
| 10/2 | 2026/09/24 07:58 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/io.c",
"FirstLine": 105,
"LineCount": 50
}Results: {
"Contents": " 105:\t\tlocal_bh_enable();\n 106:\t}\n 107:\t\n 108:\tvoid ovpn_decrypt_post(void *data, int ret)\n 109:\t{\n 110:\t\tstruct ovpn_crypto_key_slot *ks;\n 111:\t\tunsigned int payload_offset = 0;\n 112:\t\tstruct sk_buff *skb = data;\n 113:\t\tstruct ovpn_socket *sock;\n 114:\t\tstruct ovpn_peer *peer;\n 115:\t\t__be16 proto;\n 116:\t\t__be32 *pid;\n 117:\t\n 118:\t\t/* crypto is happening asynchronously. this function will be called\n 119:\t\t * again later by the crypto callback with a proper return code\n 120:\t\t */\n 121:\t\tif (unlikely(ret == -EINPROGRESS))\n 122:\t\t\treturn;\n 123:\t\n 124:\t\tpayload_offset = ovpn_skb_cb(skb)-\u003epayload_offset;\n 125:\t\tks = ovpn_skb_cb(skb)-\u003eks;\n 126:\t\tpeer = ovpn_skb_cb(skb)-\u003epeer;\n 127:\t\n 128:\t\t/* crypto is done, cleanup skb CB and its members */\n 129:\t\tkfree(ovpn_skb_cb(skb)-\u003ecrypto_tmp);\n 130:\t\n 131:\t\tif (unlikely(ret \u003c 0))\n 132:\t\t\tgoto drop;\n 133:\t\n 134:\t\t/* PID sits after the op */\n 135:\t\tpid = (__force __be32 *)(skb-\u003edata + OVPN_OPCODE_SIZE);\n 136:\t\tret = ovpn_pktid_recv(\u0026ks-\u003epid_recv, ntohl(*pid), 0);\n 137:\t\tif (unlikely(ret \u003c 0)) {\n 138:\t\t\tnet_err_ratelimited(\"%s: PKT ID RX error for peer %u: %d\\n\",\n 139:\t\t\t\t\t netdev_name(peer-\u003eovpn-\u003edev), peer-\u003eid,\n 140:\t\t\t\t\t ret);\n 141:\t\t\tgoto drop;\n 142:\t\t}\n 143:\t\n 144:\t\t/* keep track of last received authenticated packet for keepalive */\n 145:\t\tWRITE_ONCE(peer-\u003elast_recv, ktime_get_boottime_seconds());\n 146:\t\n 147:\t\trcu_read_lock();\n 148:\t\tsock = rcu_dereference(peer-\u003esock);\n 149:\t\tif (sock \u0026\u0026 sock-\u003esk-\u003esk_protocol == IPPROTO_UDP)\n 150:\t\t\t/* check if this peer changed local or remote endpoint */\n 151:\t\t\tovpn_peer_endpoints_update(peer, skb);\n 152:\t\trcu_read_unlock();\n 153:\t\n 154:\t\t/* point to encapsulated IP packet */\n"
} |
| 11/2 | 2026/09/24 07:58 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 25281 output: 38 thoughts: 50 Thoughts: Okay, here's my interpretation of those thoughts, tailored for an expert audience, presented in the first person: **Decoding OpenVPN Packet Handling: A Quick Re-Evaluation** Alright, let me think this through. My immediate concern is the `peer` pointer within the OpenVPN context, specifically in the `ovpn_decrypt_post` and `ovpn_encrypt_post` functions. I know that `peer` is derived from `ovpn_skb_cb(skb)->peer;` in the decryption post-processing stage. The crucial detail here is that, at the point of calling `ovpn_decrypt_post`, `peer` *should* always be initialized and non-null. This is a fundamental assumption, and any deviation would indicate a serious problem, possibly related to connection establishment or packet handling logic. Now, as I start to consider the `ovpn_encrypt_post` function, I am going to see if that same non-null guarantee holds true there, or if that is even necessary. I would assume that it is. I am curious if there are any subtle differences in the state of `peer` at the time of calling the encryption post-processing routine. This is something I'll need to examine closely. Any insights I gain on the decryption side can likely be applied to the encryption side, which can help me understand this codebase much quicker. |
| 12/2 | 2026/09/24 07:58 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/io.c",
"FirstLine": 235,
"LineCount": 40
}Results: {
"Contents": " 235:\t}\n 236:\t\n 237:\tvoid ovpn_encrypt_post(void *data, int ret)\n 238:\t{\n 239:\t\tstruct ovpn_crypto_key_slot *ks;\n 240:\t\tstruct sk_buff *skb = data;\n 241:\t\tstruct ovpn_socket *sock;\n 242:\t\tstruct ovpn_peer *peer;\n 243:\t\tunsigned int orig_len;\n 244:\t\n 245:\t\t/* encryption is happening asynchronously. This function will be\n 246:\t\t * called later by the crypto callback with a proper return value\n 247:\t\t */\n 248:\t\tif (unlikely(ret == -EINPROGRESS))\n 249:\t\t\treturn;\n 250:\t\n 251:\t\tks = ovpn_skb_cb(skb)-\u003eks;\n 252:\t\tpeer = ovpn_skb_cb(skb)-\u003epeer;\n 253:\t\n 254:\t\t/* crypto is done, cleanup skb CB and its members */\n 255:\t\tkfree(ovpn_skb_cb(skb)-\u003ecrypto_tmp);\n 256:\t\n 257:\t\tif (unlikely(ret == -ERANGE)) {\n 258:\t\t\t/* we ran out of IVs and we must kill the key as it can't be\n 259:\t\t\t * use anymore\n 260:\t\t\t */\n 261:\t\t\tnetdev_warn(peer-\u003eovpn-\u003edev,\n 262:\t\t\t\t \"killing key %u for peer %u\\n\", ks-\u003ekey_id,\n 263:\t\t\t\t peer-\u003eid);\n 264:\t\t\tif (ovpn_crypto_kill_key(\u0026peer-\u003ecrypto, ks-\u003ekey_id))\n 265:\t\t\t\t/* let userspace know so that a new key must be negotiated */\n 266:\t\t\t\tovpn_nl_key_swap_notify(peer, ks-\u003ekey_id);\n 267:\t\n 268:\t\t\tgoto err;\n 269:\t\t}\n 270:\t\n 271:\t\tif (unlikely(ret \u003c 0))\n 272:\t\t\tgoto err;\n 273:\t\n 274:\t\tskb_mark_not_on_list(skb);\n"
} |
| 13/2 | 2026/09/24 07:58 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 26266 output: 39 thoughts: 60 Thoughts: Okay, here's my interpretation of that thought process, tailored for an expert audience: **Diving into the OpenVPN Netlink Code** Right, let's get down to brass tacks. I need to refresh my memory on the OpenVPN netlink interface implementation. My first port of call will be `drivers/net/ovpn/netlink.c`. I'm going to zero in on specific sections because I know exactly where the interesting bits usually reside. Specifically, I'm thinking lines 540 through 670, and then I'll jump further down to lines 1180 to 1230. That should give me a solid overview of the relevant netlink message handling and how they translate into OpenVPN configuration calls or packet routing. Knowing the core functionality between these ranges will save me time going through the full code, especially because I have seen it before. |
| 14/2 | 2026/09/24 07:58 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/netlink.c",
"FirstLine": 546,
"LineCount": 80
}Results: {
"Contents": " 546:\t\treturn 0;\n 547:\t}\n 548:\t\n 549:\tstatic int ovpn_nl_fill_peer(struct sk_buff *skb, const struct genl_info *info,\n 550:\t\t\t\t const struct ovpn_peer *peer)\n 551:\t{\n 552:\t\tconst struct ovpn_bind *bind;\n 553:\t\tstruct ovpn_socket *sock;\n 554:\t\tint ret = -EMSGSIZE;\n 555:\t\t__be16 local_port;\n 556:\t\tint id;\n 557:\t\n 558:\t\trcu_read_lock();\n 559:\t\tsock = rcu_dereference(peer-\u003esock);\n 560:\t\tif (!sock) {\n 561:\t\t\tret = -EINVAL;\n 562:\t\t\tgoto err_unlock;\n 563:\t\t}\n 564:\t\n 565:\t\tif (info \u0026\u0026 !net_eq(genl_info_net(info), sock_net(sock-\u003esk))) {\n 566:\t\t\tid = peernet2id_alloc(genl_info_net(info),\n 567:\t\t\t\t\t sock_net(sock-\u003esk),\n 568:\t\t\t\t\t GFP_ATOMIC);\n 569:\t\t\tif (nla_put_s32(skb, OVPN_A_PEER_SOCKET_NETNSID, id))\n 570:\t\t\t\tgoto err_unlock;\n 571:\t\t}\n 572:\t\tlocal_port = inet_sk(sock-\u003esk)-\u003einet_sport;\n 573:\t\trcu_read_unlock();\n 574:\t\n 575:\t\tif (nla_put_u32(skb, OVPN_A_PEER_ID, peer-\u003eid))\n 576:\t\t\treturn -EMSGSIZE;\n 577:\t\n 578:\t\tif (nla_put_u32(skb, OVPN_A_PEER_TX_ID, peer-\u003etx_id))\n 579:\t\t\treturn -EMSGSIZE;\n 580:\t\n 581:\t\tif (peer-\u003evpn_addrs.ipv4.s_addr != htonl(INADDR_ANY))\n 582:\t\t\tif (nla_put_in_addr(skb, OVPN_A_PEER_VPN_IPV4,\n 583:\t\t\t\t\t peer-\u003evpn_addrs.ipv4.s_addr))\n 584:\t\t\t\treturn -EMSGSIZE;\n 585:\t\n 586:\t\tif (!ipv6_addr_equal(\u0026peer-\u003evpn_addrs.ipv6, \u0026in6addr_any))\n 587:\t\t\tif (nla_put_in6_addr(skb, OVPN_A_PEER_VPN_IPV6,\n 588:\t\t\t\t\t \u0026peer-\u003evpn_addrs.ipv6))\n 589:\t\t\t\treturn -EMSGSIZE;\n 590:\t\n 591:\t\tif (nla_put_u32(skb, OVPN_A_PEER_KEEPALIVE_INTERVAL,\n 592:\t\t\t\tpeer-\u003ekeepalive_interval) ||\n 593:\t\t nla_put_u32(skb, OVPN_A_PEER_KEEPALIVE_TIMEOUT,\n 594:\t\t\t\tpeer-\u003ekeepalive_timeout))\n 595:\t\t\treturn -EMSGSIZE;\n 596:\t\n 597:\t\trcu_read_lock();\n 598:\t\tbind = rcu_dereference(peer-\u003ebind);\n 599:\t\tif (bind) {\n 600:\t\t\tif (bind-\u003eremote.in4.sin_family == AF_INET) {\n 601:\t\t\t\tif (nla_put_in_addr(skb, OVPN_A_PEER_REMOTE_IPV4,\n 602:\t\t\t\t\t\t bind-\u003eremote.in4.sin_addr.s_addr) ||\n 603:\t\t\t\t nla_put_net16(skb, OVPN_A_PEER_REMOTE_PORT,\n 604:\t\t\t\t\t\t bind-\u003eremote.in4.sin_port) ||\n 605:\t\t\t\t nla_put_in_addr(skb, OVPN_A_PEER_LOCAL_IPV4,\n 606:\t\t\t\t\t\t bind-\u003elocal.ipv4.s_addr))\n 607:\t\t\t\t\tgoto err_unlock;\n 608:\t\t\t} else if (bind-\u003eremote.in4.sin_family == AF_INET6) {\n 609:\t\t\t\tif (nla_put_in6_addr(skb, OVPN_A_PEER_REMOTE_IPV6,\n 610:\t\t\t\t\t\t \u0026bind-\u003eremote.in6.sin6_addr) ||\n 611:\t\t\t\t nla_put_u32(skb, OVPN_A_PEER_REMOTE_IPV6_SCOPE_ID,\n 612:\t\t\t\t\t\tbind-\u003eremote.in6.sin6_scope_id) ||\n 613:\t\t\t\t nla_put_net16(skb, OVPN_A_PEER_REMOTE_PORT,\n 614:\t\t\t\t\t\t bind-\u003eremote.in6.sin6_port) ||\n 615:\t\t\t\t nla_put_in6_addr(skb, OVPN_A_PEER_LOCAL_IPV6,\n 616:\t\t\t\t\t\t \u0026bind-\u003elocal.ipv6))\n 617:\t\t\t\t\tgoto err_unlock;\n 618:\t\t\t}\n 619:\t\t}\n 620:\t\trcu_read_unlock();\n 621:\t\n 622:\t\tif (nla_put_net16(skb, OVPN_A_PEER_LOCAL_PORT, local_port) ||\n 623:\t\t /* VPN RX stats */\n 624:\t\t nla_put_uint(skb, OVPN_A_PEER_VPN_RX_BYTES,\n 625:\t\t\t\t atomic64_read(\u0026peer-\u003evpn_stats.rx.bytes)) ||\n"
} |
| 15/2 | 2026/09/24 07:58 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 28106 output: 40 thoughts: 32 Thoughts: Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person: **Delving into the `ovpn_nl_peer_del_notify` Function** Alright, I'm shifting my focus to `drivers/net/ovpn/netlink.c` again. Specifically, I need to take a closer look at the `ovpn_nl_peer_del_notify` function. I remember seeing it mentioned in passing, but I didn't give it the deep dive it deserves. Considering the scope of this project and the potential for delicate race conditions related to peer deletion and notification, I can't afford to leave any stone unturned here. I suspect this function is where the netlink messages signaling peer deletion are crafted and sent, or where the appropriate logic that triggers that is handled. Depending on what I find, this function probably plays a critical role in synchronizing the kernel's internal OpenVPN peer state with userspace applications and ensuring that state is correct for things like routing table updates and policy changes. I'll need to pay close attention to the error handling within this function as well, as missed notifications could easily lead to routing blackholes or stale connections, which is obviously unacceptable. My intention is to analyze its behavior under different scenarios, including rapid peer churn and concurrent operations. I also need to understand how the function interfaces with other related parts of the OpenVPN module. I'll cross-reference it with the surrounding code to grasp its role in the bigger picture. |
| 16/2 | 2026/09/24 07:58 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/netlink.c",
"FirstLine": 1190,
"LineCount": 40
}Results: {
"Contents": "1190:\t\tif (!msg)\n1191:\t\t\treturn -ENOMEM;\n1192:\t\n1193:\t\thdr = genlmsg_put(msg, 0, 0, \u0026ovpn_nl_family, 0, OVPN_CMD_PEER_DEL_NTF);\n1194:\t\tif (!hdr) {\n1195:\t\t\tret = -ENOBUFS;\n1196:\t\t\tgoto err_free_msg;\n1197:\t\t}\n1198:\t\n1199:\t\tif (nla_put_u32(msg, OVPN_A_IFINDEX, peer-\u003eovpn-\u003edev-\u003eifindex))\n1200:\t\t\tgoto err_cancel_msg;\n1201:\t\n1202:\t\tattr = nla_nest_start(msg, OVPN_A_PEER);\n1203:\t\tif (!attr)\n1204:\t\t\tgoto err_cancel_msg;\n1205:\t\n1206:\t\tif (nla_put_u32(msg, OVPN_A_PEER_DEL_REASON, peer-\u003edelete_reason))\n1207:\t\t\tgoto err_cancel_msg;\n1208:\t\n1209:\t\tret = ovpn_nl_fill_peer(msg, NULL, peer);\n1210:\t\tif (ret \u003c 0)\n1211:\t\t\tgoto err_cancel_msg;\n1212:\t\n1213:\t\tnla_nest_end(msg, attr);\n1214:\t\n1215:\t\tgenlmsg_end(msg, hdr);\n1216:\t\n1217:\t\trcu_read_lock();\n1218:\t\tsock = rcu_dereference(peer-\u003esock);\n1219:\t\tif (!sock) {\n1220:\t\t\tret = -EINVAL;\n1221:\t\t\tgoto err_unlock;\n1222:\t\t}\n1223:\t\tgenlmsg_multicast_netns(\u0026ovpn_nl_family, sock_net(sock-\u003esk), msg, 0,\n1224:\t\t\t\t\tOVPN_NLGRP_PEERS, GFP_ATOMIC);\n1225:\t\trcu_read_unlock();\n1226:\t\n1227:\t\treturn 0;\n1228:\t\n1229:\terr_unlock:\n"
} |
| 17/2 | 2026/09/24 07:58 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 29114 output: 40 thoughts: 80 Thoughts: Okay, let me take a look at this `ovpn_nl_peer_del_notify` function. Right, it's meant to notify something about the deletion of an OpenVPN peer. Let's dig into the code a little. Specifically, I'm concerned about the size of the message buffer, `msg`. I see the function definition, `int ovpn_nl_peer_del_notify(struct ovpn_peer *peer)`. Now, the important part: I need to examine how the memory for that message is allocated. Let me check the code from lines 1180 to 1195 to see how the buffer `msg` is sized. That's where the allocation must happen. I want to see how that's done and make sure it's correct for our uses. |
| 18/2 | 2026/09/24 07:58 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/netlink.c",
"FirstLine": 1175,
"LineCount": 20
}Results: {
"Contents": "1175:\t *\n1176:\t * Return: 0 on success or a negative error code otherwise\n1177:\t */\n1178:\tint ovpn_nl_peer_del_notify(struct ovpn_peer *peer)\n1179:\t{\n1180:\t\tstruct ovpn_socket *sock;\n1181:\t\tstruct sk_buff *msg;\n1182:\t\tstruct nlattr *attr;\n1183:\t\tint ret = -EMSGSIZE;\n1184:\t\tvoid *hdr;\n1185:\t\n1186:\t\tnetdev_info(peer-\u003eovpn-\u003edev, \"deleting peer with id %u, reason %d\\n\",\n1187:\t\t\t peer-\u003eid, peer-\u003edelete_reason);\n1188:\t\n1189:\t\tmsg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);\n1190:\t\tif (!msg)\n1191:\t\t\treturn -ENOMEM;\n1192:\t\n1193:\t\thdr = genlmsg_put(msg, 0, 0, \u0026ovpn_nl_family, 0, OVPN_CMD_PEER_DEL_NTF);\n1194:\t\tif (!hdr) {\n"
} |
| 19/2 | 2026/09/24 07:58 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 29742 output: 25 thoughts: 58 Thoughts: Okay, let's dive into this OpenVPN driver situation. **Investigating the OpenVPN Driver Configuration** My initial thought is to figure out the current status of the OpenVPN driver. I need to understand how it's configured and whether it's even reachable right now. So, my next step is clear: I need to get some information on that. I'm going to look for the Kconfig file for the OpenVPN driver, and if that doesn't work, I'll go for the Makefile. I'll start with `/drivers/net/ovpn/Kconfig` and `/drivers/net/Kconfig`, and finally `/drivers/net/ovpn/Makefile` to see how it's all put together. |
| 20/2 | 2026/09/24 07:58 | tool | grepper |
0mArgs:{
"Expression": "OVPN",
"PathPrefix": "drivers/net"
}Results: {
"Output": "\nFull output is too long, showing 500 out of 1500 lines.\nUse more precise expression if possible.\n\ndrivers/net/Kconfig=92=config WIREGUARD_DEBUG\n--\ndrivers/net/Kconfig-102-\ndrivers/net/Kconfig:103:config OVPN\ndrivers/net/Kconfig-104-\ttristate \"OpenVPN data channel offload\"\n--\ndrivers/net/Makefile=13=obj-$(CONFIG_WIREGUARD) += wireguard/\ndrivers/net/Makefile:14:obj-$(CONFIG_OVPN) += ovpn/\ndrivers/net/Makefile-15-obj-$(CONFIG_EQUALIZER) += eql.o\n--\ndrivers/net/ovpn/Makefile-8-\ndrivers/net/ovpn/Makefile:9:obj-$(CONFIG_OVPN) := ovpn.o\ndrivers/net/ovpn/Makefile-10-ovpn-y += bind.o\n--\ndrivers/net/ovpn/bind.h-9-\ndrivers/net/ovpn/bind.h:10:#ifndef _NET_OVPN_OVPNBIND_H_\ndrivers/net/ovpn/bind.h:11:#define _NET_OVPN_OVPNBIND_H_\ndrivers/net/ovpn/bind.h-12-\n--\ndrivers/net/ovpn/bind.h=99=void ovpn_bind_reset(struct ovpn_peer *peer, struct ovpn_bind *bind);\ndrivers/net/ovpn/bind.h-100-\ndrivers/net/ovpn/bind.h:101:#endif /* _NET_OVPN_OVPNBIND_H_ */\n--\ndrivers/net/ovpn/crypto.c=78=int ovpn_crypto_state_reset(struct ovpn_crypto_state *cs,\n--\ndrivers/net/ovpn/crypto.c-83-\ndrivers/net/ovpn/crypto.c:84:\tif (pkr-\u003eslot != OVPN_KEY_SLOT_PRIMARY \u0026\u0026\ndrivers/net/ovpn/crypto.c:85:\t pkr-\u003eslot != OVPN_KEY_SLOT_SECONDARY)\ndrivers/net/ovpn/crypto.c-86-\t\treturn -EINVAL;\n--\ndrivers/net/ovpn/crypto.c-94-\tswitch (pkr-\u003eslot) {\ndrivers/net/ovpn/crypto.c:95:\tcase OVPN_KEY_SLOT_PRIMARY:\ndrivers/net/ovpn/crypto.c-96-\t\told = rcu_replace_pointer(cs-\u003eslots[idx], new,\n--\ndrivers/net/ovpn/crypto.c-98-\t\tbreak;\ndrivers/net/ovpn/crypto.c:99:\tcase OVPN_KEY_SLOT_SECONDARY:\ndrivers/net/ovpn/crypto.c-100-\t\told = rcu_replace_pointer(cs-\u003eslots[!idx], new,\n--\ndrivers/net/ovpn/crypto.c=112=void ovpn_crypto_key_slot_delete(struct ovpn_crypto_state *cs,\n--\ndrivers/net/ovpn/crypto.c-117-\ndrivers/net/ovpn/crypto.c:118:\tif (slot != OVPN_KEY_SLOT_PRIMARY \u0026\u0026\ndrivers/net/ovpn/crypto.c:119:\t slot != OVPN_KEY_SLOT_SECONDARY) {\ndrivers/net/ovpn/crypto.c-120-\t\tpr_warn(\"Invalid slot to release: %u\\n\", slot);\n--\ndrivers/net/ovpn/crypto.c-126-\tswitch (slot) {\ndrivers/net/ovpn/crypto.c:127:\tcase OVPN_KEY_SLOT_PRIMARY:\ndrivers/net/ovpn/crypto.c-128-\t\tks = rcu_replace_pointer(cs-\u003eslots[idx], NULL,\n--\ndrivers/net/ovpn/crypto.c-130-\t\tbreak;\ndrivers/net/ovpn/crypto.c:131:\tcase OVPN_KEY_SLOT_SECONDARY:\ndrivers/net/ovpn/crypto.c-132-\t\tks = rcu_replace_pointer(cs-\u003eslots[!idx], NULL,\n--\ndrivers/net/ovpn/crypto.c=176=int ovpn_crypto_config_get(struct ovpn_crypto_state *cs,\n--\ndrivers/net/ovpn/crypto.c-183-\tswitch (slot) {\ndrivers/net/ovpn/crypto.c:184:\tcase OVPN_KEY_SLOT_PRIMARY:\ndrivers/net/ovpn/crypto.c-185-\t\tidx = cs-\u003eprimary_idx;\ndrivers/net/ovpn/crypto.c-186-\t\tbreak;\ndrivers/net/ovpn/crypto.c:187:\tcase OVPN_KEY_SLOT_SECONDARY:\ndrivers/net/ovpn/crypto.c-188-\t\tidx = !cs-\u003eprimary_idx;\n--\ndrivers/net/ovpn/crypto.h-9-\ndrivers/net/ovpn/crypto.h:10:#ifndef _NET_OVPN_OVPNCRYPTO_H_\ndrivers/net/ovpn/crypto.h:11:#define _NET_OVPN_OVPNCRYPTO_H_\ndrivers/net/ovpn/crypto.h-12-\n--\ndrivers/net/ovpn/crypto.h=40=struct ovpn_crypto_key_slot {\n--\ndrivers/net/ovpn/crypto.h-44-\tstruct crypto_aead *decrypt;\ndrivers/net/ovpn/crypto.h:45:\tu8 nonce_tail_xmit[OVPN_NONCE_TAIL_SIZE];\ndrivers/net/ovpn/crypto.h:46:\tu8 nonce_tail_recv[OVPN_NONCE_TAIL_SIZE];\ndrivers/net/ovpn/crypto.h-47-\n--\ndrivers/net/ovpn/crypto.h=145=bool ovpn_crypto_kill_key(struct ovpn_crypto_state *cs, u8 key_id);\ndrivers/net/ovpn/crypto.h-146-\ndrivers/net/ovpn/crypto.h:147:#endif /* _NET_OVPN_OVPNCRYPTO_H_ */\n--\ndrivers/net/ovpn/crypto_aead.c-26-\ndrivers/net/ovpn/crypto_aead.c:27:#define OVPN_AUTH_TAG_SIZE\t16\ndrivers/net/ovpn/crypto_aead.c:28:#define OVPN_AAD_SIZE\t\t(OVPN_OPCODE_SIZE + OVPN_NONCE_WIRE_SIZE)\ndrivers/net/ovpn/crypto_aead.c-29-\n--\ndrivers/net/ovpn/crypto_aead.c=33=static int ovpn_aead_encap_overhead(const struct ovpn_crypto_key_slot *ks)\ndrivers/net/ovpn/crypto_aead.c-34-{\ndrivers/net/ovpn/crypto_aead.c:35:\treturn OVPN_OPCODE_SIZE +\t\t\t/* OP header size */\ndrivers/net/ovpn/crypto_aead.c-36-\t\tsizeof(u32) +\t\t\t\t/* Packet ID */\n--\ndrivers/net/ovpn/crypto_aead.c=56=static unsigned int ovpn_aead_crypto_tmp_size(struct crypto_aead *tfm,\n--\ndrivers/net/ovpn/crypto_aead.c-58-{\ndrivers/net/ovpn/crypto_aead.c:59:\tunsigned int len = OVPN_NONCE_SIZE;\ndrivers/net/ovpn/crypto_aead.c-60-\ndrivers/net/ovpn/crypto_aead.c:61:\tDEBUG_NET_WARN_ON_ONCE(crypto_aead_ivsize(tfm) != OVPN_NONCE_SIZE);\ndrivers/net/ovpn/crypto_aead.c-62-\n--\ndrivers/net/ovpn/crypto_aead.c=138=int ovpn_aead_encrypt(struct ovpn_peer *peer, struct ovpn_crypto_key_slot *ks,\n--\ndrivers/net/ovpn/crypto_aead.c-162-\t */\ndrivers/net/ovpn/crypto_aead.c:163:\tif (unlikely(skb_cow_head(skb, OVPN_HEAD_ROOM)))\ndrivers/net/ovpn/crypto_aead.c-164-\t\treturn -ENOBUFS;\n--\ndrivers/net/ovpn/crypto_aead.c-186-\t/* sg table:\ndrivers/net/ovpn/crypto_aead.c:187:\t * 0: op, wire nonce (AD, len=OVPN_OP_SIZE_V2+OVPN_NONCE_WIRE_SIZE),\ndrivers/net/ovpn/crypto_aead.c-188-\t * 1, 2, 3, ..., n: payload,\n--\ndrivers/net/ovpn/crypto_aead.c-217-\t/* make space for packet id and push it to the front */\ndrivers/net/ovpn/crypto_aead.c:218:\t__skb_push(skb, OVPN_NONCE_WIRE_SIZE);\ndrivers/net/ovpn/crypto_aead.c:219:\tmemcpy(skb-\u003edata, iv, OVPN_NONCE_WIRE_SIZE);\ndrivers/net/ovpn/crypto_aead.c-220-\ndrivers/net/ovpn/crypto_aead.c-221-\t/* add packet op as head of additional data */\ndrivers/net/ovpn/crypto_aead.c:222:\top = ovpn_opcode_compose(OVPN_DATA_V2, ks-\u003ekey_id, peer-\u003etx_id);\ndrivers/net/ovpn/crypto_aead.c:223:\t__skb_push(skb, OVPN_OPCODE_SIZE);\ndrivers/net/ovpn/crypto_aead.c:224:\tBUILD_BUG_ON(sizeof(op) != OVPN_OPCODE_SIZE);\ndrivers/net/ovpn/crypto_aead.c-225-\t*((__force __be32 *)skb-\u003edata) = htonl(op);\n--\ndrivers/net/ovpn/crypto_aead.c-227-\t/* AEAD Additional data */\ndrivers/net/ovpn/crypto_aead.c:228:\tsg_set_buf(sg, skb-\u003edata, OVPN_AAD_SIZE);\ndrivers/net/ovpn/crypto_aead.c-229-\n--\ndrivers/net/ovpn/crypto_aead.c-234-\t\t\t skb-\u003elen - ovpn_aead_encap_overhead(ks), iv);\ndrivers/net/ovpn/crypto_aead.c:235:\taead_request_set_ad(req, OVPN_AAD_SIZE);\ndrivers/net/ovpn/crypto_aead.c-236-\n--\ndrivers/net/ovpn/crypto_aead.c=241=int ovpn_aead_decrypt(struct ovpn_peer *peer, struct ovpn_crypto_key_slot *ks,\n--\ndrivers/net/ovpn/crypto_aead.c-252-\ndrivers/net/ovpn/crypto_aead.c:253:\tpayload_offset = OVPN_AAD_SIZE + tag_size;\ndrivers/net/ovpn/crypto_aead.c-254-\tpayload_len = skb-\u003elen - payload_offset;\n--\ndrivers/net/ovpn/crypto_aead.c-291-\t/* sg table:\ndrivers/net/ovpn/crypto_aead.c:292:\t * 0: op, wire nonce (AD, len=OVPN_OPCODE_SIZE+OVPN_NONCE_WIRE_SIZE),\ndrivers/net/ovpn/crypto_aead.c-293-\t * 1, 2, 3, ..., n: payload,\n--\ndrivers/net/ovpn/crypto_aead.c-298-\t/* packet op is head of additional data */\ndrivers/net/ovpn/crypto_aead.c:299:\tsg_set_buf(sg, skb-\u003edata, OVPN_AAD_SIZE);\ndrivers/net/ovpn/crypto_aead.c-300-\n--\ndrivers/net/ovpn/crypto_aead.c-309-\t/* append auth_tag onto scatterlist */\ndrivers/net/ovpn/crypto_aead.c:310:\tsg_set_buf(sg + ret + 1, skb-\u003edata + OVPN_AAD_SIZE, tag_size);\ndrivers/net/ovpn/crypto_aead.c-311-\ndrivers/net/ovpn/crypto_aead.c-312-\t/* copy nonce into IV buffer */\ndrivers/net/ovpn/crypto_aead.c:313:\tmemcpy(iv, skb-\u003edata + OVPN_OPCODE_SIZE, OVPN_NONCE_WIRE_SIZE);\ndrivers/net/ovpn/crypto_aead.c:314:\tmemcpy(iv + OVPN_NONCE_WIRE_SIZE, ks-\u003enonce_tail_recv,\ndrivers/net/ovpn/crypto_aead.c:315:\t OVPN_NONCE_TAIL_SIZE);\ndrivers/net/ovpn/crypto_aead.c-316-\n--\ndrivers/net/ovpn/crypto_aead.c-321-\ndrivers/net/ovpn/crypto_aead.c:322:\taead_request_set_ad(req, OVPN_AAD_SIZE);\ndrivers/net/ovpn/crypto_aead.c-323-\n--\ndrivers/net/ovpn/crypto_aead.c=329=static struct crypto_aead *ovpn_aead_init(const char *title,\n--\ndrivers/net/ovpn/crypto_aead.c-351-\ndrivers/net/ovpn/crypto_aead.c:352:\tret = crypto_aead_setauthsize(aead, OVPN_AUTH_TAG_SIZE);\ndrivers/net/ovpn/crypto_aead.c-353-\tif (ret) {\n--\ndrivers/net/ovpn/crypto_aead.c-359-\t/* basic AEAD assumption\ndrivers/net/ovpn/crypto_aead.c:360:\t * all current algorithms use OVPN_NONCE_SIZE.\ndrivers/net/ovpn/crypto_aead.c-361-\t * ovpn_aead_crypto_tmp_size and ovpn_aead_encrypt/decrypt\n--\ndrivers/net/ovpn/crypto_aead.c-363-\t */\ndrivers/net/ovpn/crypto_aead.c:364:\tif (crypto_aead_ivsize(aead) != OVPN_NONCE_SIZE) {\ndrivers/net/ovpn/crypto_aead.c:365:\t\tpr_err(\"%s IV size must be %d\\n\", title, OVPN_NONCE_SIZE);\ndrivers/net/ovpn/crypto_aead.c-366-\t\tret = -EINVAL;\n--\ndrivers/net/ovpn/crypto_aead.c=401=ovpn_aead_crypto_key_slot_new(const struct ovpn_key_config *kc)\n--\ndrivers/net/ovpn/crypto_aead.c-408-\tswitch (kc-\u003ecipher_alg) {\ndrivers/net/ovpn/crypto_aead.c:409:\tcase OVPN_CIPHER_ALG_AES_GCM:\ndrivers/net/ovpn/crypto_aead.c-410-\t\talg_name = ALG_NAME_AES;\ndrivers/net/ovpn/crypto_aead.c-411-\t\tbreak;\ndrivers/net/ovpn/crypto_aead.c:412:\tcase OVPN_CIPHER_ALG_CHACHA20_POLY1305:\ndrivers/net/ovpn/crypto_aead.c-413-\t\talg_name = ALG_NAME_CHACHAPOLY;\n--\ndrivers/net/ovpn/crypto_aead.c-418-\ndrivers/net/ovpn/crypto_aead.c:419:\tif (kc-\u003eencrypt.nonce_tail_size != OVPN_NONCE_TAIL_SIZE ||\ndrivers/net/ovpn/crypto_aead.c:420:\t kc-\u003edecrypt.nonce_tail_size != OVPN_NONCE_TAIL_SIZE)\ndrivers/net/ovpn/crypto_aead.c-421-\t\treturn ERR_PTR(-EINVAL);\n--\ndrivers/net/ovpn/crypto_aead.c-452-\tmemcpy(ks-\u003enonce_tail_xmit, kc-\u003eencrypt.nonce_tail,\ndrivers/net/ovpn/crypto_aead.c:453:\t OVPN_NONCE_TAIL_SIZE);\ndrivers/net/ovpn/crypto_aead.c-454-\tmemcpy(ks-\u003enonce_tail_recv, kc-\u003edecrypt.nonce_tail,\ndrivers/net/ovpn/crypto_aead.c:455:\t OVPN_NONCE_TAIL_SIZE);\ndrivers/net/ovpn/crypto_aead.c-456-\n--\ndrivers/net/ovpn/crypto_aead.c=469=enum ovpn_cipher_alg ovpn_aead_crypto_alg(struct ovpn_crypto_key_slot *ks)\n--\ndrivers/net/ovpn/crypto_aead.c-473-\tif (!ks-\u003eencrypt)\ndrivers/net/ovpn/crypto_aead.c:474:\t\treturn OVPN_CIPHER_ALG_NONE;\ndrivers/net/ovpn/crypto_aead.c-475-\n--\ndrivers/net/ovpn/crypto_aead.c-478-\tif (!strcmp(alg_name, ALG_NAME_AES))\ndrivers/net/ovpn/crypto_aead.c:479:\t\treturn OVPN_CIPHER_ALG_AES_GCM;\ndrivers/net/ovpn/crypto_aead.c-480-\telse if (!strcmp(alg_name, ALG_NAME_CHACHAPOLY))\ndrivers/net/ovpn/crypto_aead.c:481:\t\treturn OVPN_CIPHER_ALG_CHACHA20_POLY1305;\ndrivers/net/ovpn/crypto_aead.c-482-\telse\ndrivers/net/ovpn/crypto_aead.c:483:\t\treturn OVPN_CIPHER_ALG_NONE;\ndrivers/net/ovpn/crypto_aead.c-484-}\n--\ndrivers/net/ovpn/crypto_aead.h-9-\ndrivers/net/ovpn/crypto_aead.h:10:#ifndef _NET_OVPN_OVPNAEAD_H_\ndrivers/net/ovpn/crypto_aead.h:11:#define _NET_OVPN_OVPNAEAD_H_\ndrivers/net/ovpn/crypto_aead.h-12-\n--\ndrivers/net/ovpn/crypto_aead.h=26=enum ovpn_cipher_alg ovpn_aead_crypto_alg(struct ovpn_crypto_key_slot *ks);\ndrivers/net/ovpn/crypto_aead.h-27-\ndrivers/net/ovpn/crypto_aead.h:28:#endif /* _NET_OVPN_OVPNAEAD_H_ */\n--\ndrivers/net/ovpn/io.c-29-\ndrivers/net/ovpn/io.c:30:const unsigned char ovpn_keepalive_message[OVPN_KEEPALIVE_SIZE] = {\ndrivers/net/ovpn/io.c-31-\t0x2a, 0x18, 0x7b, 0xf3, 0x64, 0x1e, 0xb4, 0xcb,\n--\ndrivers/net/ovpn/io.c=43=static bool ovpn_is_keepalive(struct sk_buff *skb)\n--\ndrivers/net/ovpn/io.c-47-\ndrivers/net/ovpn/io.c:48:\tif (skb-\u003elen != OVPN_KEEPALIVE_SIZE)\ndrivers/net/ovpn/io.c-49-\t\treturn false;\ndrivers/net/ovpn/io.c-50-\ndrivers/net/ovpn/io.c:51:\tif (!pskb_may_pull(skb, OVPN_KEEPALIVE_SIZE))\ndrivers/net/ovpn/io.c-52-\t\treturn false;\ndrivers/net/ovpn/io.c-53-\ndrivers/net/ovpn/io.c:54:\treturn !memcmp(skb-\u003edata, ovpn_keepalive_message, OVPN_KEEPALIVE_SIZE);\ndrivers/net/ovpn/io.c-55-}\n--\ndrivers/net/ovpn/io.c=108=void ovpn_decrypt_post(void *data, int ret)\n--\ndrivers/net/ovpn/io.c-134-\t/* PID sits after the op */\ndrivers/net/ovpn/io.c:135:\tpid = (__force __be32 *)(skb-\u003edata + OVPN_OPCODE_SIZE);\ndrivers/net/ovpn/io.c-136-\tret = ovpn_pktid_recv(\u0026ks-\u003epid_recv, ntohl(*pid), 0);\n--\ndrivers/net/ovpn/io.h-9-\ndrivers/net/ovpn/io.h:10:#ifndef _NET_OVPN_OVPN_H_\ndrivers/net/ovpn/io.h:11:#define _NET_OVPN_OVPN_H_\ndrivers/net/ovpn/io.h-12-\ndrivers/net/ovpn/io.h-13-/* DATA_V2 header size with AEAD encryption */\ndrivers/net/ovpn/io.h:14:#define OVPN_HEAD_ROOM (OVPN_OPCODE_SIZE + OVPN_NONCE_WIRE_SIZE +\t \\\ndrivers/net/ovpn/io.h-15-\t\t\t16 /* AEAD TAG length */ +\t\t\t \\\n--\ndrivers/net/ovpn/io.h-19-/* max padding required by encryption */\ndrivers/net/ovpn/io.h:20:#define OVPN_MAX_PADDING 16\ndrivers/net/ovpn/io.h-21-\ndrivers/net/ovpn/io.h:22:#define OVPN_KEEPALIVE_SIZE 16\ndrivers/net/ovpn/io.h:23:extern const unsigned char ovpn_keepalive_message[OVPN_KEEPALIVE_SIZE];\ndrivers/net/ovpn/io.h-24-\n--\ndrivers/net/ovpn/io.h=32=void ovpn_decrypt_post(void *data, int ret);\ndrivers/net/ovpn/io.h-33-\ndrivers/net/ovpn/io.h:34:#endif /* _NET_OVPN_OVPN_H_ */\n--\ndrivers/net/ovpn/main.c=40=static int ovpn_mp_alloc(struct ovpn_priv *ovpn)\n--\ndrivers/net/ovpn/main.c-43-\ndrivers/net/ovpn/main.c:44:\tif (ovpn-\u003emode != OVPN_MODE_MP)\ndrivers/net/ovpn/main.c-45-\t\treturn 0;\n--\ndrivers/net/ovpn/main.c=81=static void ovpn_net_uninit(struct net_device *dev)\n--\ndrivers/net/ovpn/main.c-85-\tdisable_delayed_work_sync(\u0026ovpn-\u003ekeepalive_work);\ndrivers/net/ovpn/main.c:86:\tovpn_peers_free(ovpn, NULL, OVPN_DEL_PEER_REASON_TEARDOWN);\ndrivers/net/ovpn/main.c-87-\tgro_cells_destroy(\u0026ovpn-\u003egro_cells);\n--\ndrivers/net/ovpn/main.c=90=static int ovpn_net_open(struct net_device *dev)\n--\ndrivers/net/ovpn/main.c-99-\t */\ndrivers/net/ovpn/main.c:100:\tif (ovpn-\u003emode == OVPN_MODE_MP) {\ndrivers/net/ovpn/main.c-101-\t\tdev_v4 = __in_dev_get_rtnl(dev);\n--\ndrivers/net/ovpn/main.c=125=static const struct device_type ovpn_type = {\ndrivers/net/ovpn/main.c:126:\t.name = OVPN_FAMILY_NAME,\ndrivers/net/ovpn/main.c-127-};\ndrivers/net/ovpn/main.c-128-\ndrivers/net/ovpn/main.c:129:static const struct nla_policy ovpn_policy[IFLA_OVPN_MAX + 1] = {\ndrivers/net/ovpn/main.c:130:\t[IFLA_OVPN_MODE] = NLA_POLICY_RANGE(NLA_U8, OVPN_MODE_P2P,\ndrivers/net/ovpn/main.c:131:\t\t\t\t\t OVPN_MODE_MP),\ndrivers/net/ovpn/main.c-132-};\n--\ndrivers/net/ovpn/main.c=158=static void ovpn_setup(struct net_device *dev)\n--\ndrivers/net/ovpn/main.c-173-\tdev-\u003eaddr_len = 0;\ndrivers/net/ovpn/main.c:174:\tdev-\u003emtu = ETH_DATA_LEN - OVPN_HEAD_ROOM;\ndrivers/net/ovpn/main.c-175-\tdev-\u003emin_mtu = IPV4_MIN_MTU;\ndrivers/net/ovpn/main.c:176:\tdev-\u003emax_mtu = IP_MAX_MTU - OVPN_HEAD_ROOM;\ndrivers/net/ovpn/main.c-177-\n--\ndrivers/net/ovpn/main.c-191-\ndrivers/net/ovpn/main.c:192:\tdev-\u003eneeded_headroom = ALIGN(OVPN_HEAD_ROOM, 4);\ndrivers/net/ovpn/main.c:193:\tdev-\u003eneeded_tailroom = OVPN_MAX_PADDING;\ndrivers/net/ovpn/main.c-194-\n--\ndrivers/net/ovpn/main.c=198=static int ovpn_newlink(struct net_device *dev,\n--\ndrivers/net/ovpn/main.c-203-\tstruct nlattr **data = params-\u003edata;\ndrivers/net/ovpn/main.c:204:\tenum ovpn_mode mode = OVPN_MODE_P2P;\ndrivers/net/ovpn/main.c-205-\tint ret;\ndrivers/net/ovpn/main.c-206-\ndrivers/net/ovpn/main.c:207:\tif (data \u0026\u0026 data[IFLA_OVPN_MODE]) {\ndrivers/net/ovpn/main.c:208:\t\tmode = nla_get_u8(data[IFLA_OVPN_MODE]);\ndrivers/net/ovpn/main.c-209-\t\tnetdev_dbg(dev, \"setting device mode: %u\\n\", mode);\n--\ndrivers/net/ovpn/main.c-224-\t */\ndrivers/net/ovpn/main.c:225:\tif (ovpn-\u003emode == OVPN_MODE_MP)\ndrivers/net/ovpn/main.c-226-\t\tnetif_carrier_on(dev);\n--\ndrivers/net/ovpn/main.c=237=static size_t ovpn_get_size(const struct net_device *dev)\ndrivers/net/ovpn/main.c-238-{\ndrivers/net/ovpn/main.c:239:\t/* IFLA_OVPN_MODE */\ndrivers/net/ovpn/main.c-240-\treturn nla_total_size(sizeof(u8));\n--\ndrivers/net/ovpn/main.c=243=static int ovpn_fill_info(struct sk_buff *skb, const struct net_device *dev)\n--\ndrivers/net/ovpn/main.c-246-\ndrivers/net/ovpn/main.c:247:\tif (nla_put_u8(skb, IFLA_OVPN_MODE, ovpn-\u003emode))\ndrivers/net/ovpn/main.c-248-\t\treturn -EMSGSIZE;\n--\ndrivers/net/ovpn/main.c=253=static struct rtnl_link_ops ovpn_link_ops = {\n--\ndrivers/net/ovpn/main.c-258-\t.policy = ovpn_policy,\ndrivers/net/ovpn/main.c:259:\t.maxtype = IFLA_OVPN_MAX,\ndrivers/net/ovpn/main.c-260-\t.newlink = ovpn_newlink,\n--\ndrivers/net/ovpn/main.h-8-\ndrivers/net/ovpn/main.h:9:#ifndef _NET_OVPN_MAIN_H_\ndrivers/net/ovpn/main.h:10:#define _NET_OVPN_MAIN_H_\ndrivers/net/ovpn/main.h-11-\ndrivers/net/ovpn/main.h=12=bool ovpn_dev_is_valid(const struct net_device *dev);\ndrivers/net/ovpn/main.h-13-\ndrivers/net/ovpn/main.h:14:#endif /* _NET_OVPN_MAIN_H_ */\n--\ndrivers/net/ovpn/netlink-gen.c=31=static const struct netlink_range_validation ovpn_a_keyconf_peer_id_range = {\n--\ndrivers/net/ovpn/netlink-gen.c-35-/* Common nested types */\ndrivers/net/ovpn/netlink-gen.c:36:const struct nla_policy ovpn_keyconf_nl_policy[OVPN_A_KEYCONF_DECRYPT_DIR + 1] = {\ndrivers/net/ovpn/netlink-gen.c:37:\t[OVPN_A_KEYCONF_PEER_ID] = NLA_POLICY_FULL_RANGE(NLA_U32, \u0026ovpn_a_keyconf_peer_id_range),\ndrivers/net/ovpn/netlink-gen.c:38:\t[OVPN_A_KEYCONF_SLOT] = NLA_POLICY_MAX(NLA_U32, 1),\ndrivers/net/ovpn/netlink-gen.c:39:\t[OVPN_A_KEYCONF_KEY_ID] = NLA_POLICY_MAX(NLA_U32, 7),\ndrivers/net/ovpn/netlink-gen.c:40:\t[OVPN_A_KEYCONF_CIPHER_ALG] = NLA_POLICY_MAX(NLA_U32, 2),\ndrivers/net/ovpn/netlink-gen.c:41:\t[OVPN_A_KEYCONF_ENCRYPT_DIR] = NLA_POLICY_NESTED(ovpn_keydir_nl_policy),\ndrivers/net/ovpn/netlink-gen.c:42:\t[OVPN_A_KEYCONF_DECRYPT_DIR] = NLA_POLICY_NESTED(ovpn_keydir_nl_policy),\ndrivers/net/ovpn/netlink-gen.c-43-};\ndrivers/net/ovpn/netlink-gen.c-44-\ndrivers/net/ovpn/netlink-gen.c:45:const struct nla_policy ovpn_keyconf_del_input_nl_policy[OVPN_A_KEYCONF_SLOT + 1] = {\ndrivers/net/ovpn/netlink-gen.c:46:\t[OVPN_A_KEYCONF_PEER_ID] = NLA_POLICY_FULL_RANGE(NLA_U32, \u0026ovpn_a_keyconf_peer_id_range),\ndrivers/net/ovpn/netlink-gen.c:47:\t[OVPN_A_KEYCONF_SLOT] = NLA_POLICY_MAX(NLA_U32, 1),\ndrivers/net/ovpn/netlink-gen.c-48-};\ndrivers/net/ovpn/netlink-gen.c-49-\ndrivers/net/ovpn/netlink-gen.c:50:const struct nla_policy ovpn_keyconf_get_nl_policy[OVPN_A_KEYCONF_CIPHER_ALG + 1] = {\ndrivers/net/ovpn/netlink-gen.c:51:\t[OVPN_A_KEYCONF_PEER_ID] = NLA_POLICY_FULL_RANGE(NLA_U32, \u0026ovpn_a_keyconf_peer_id_range),\ndrivers/net/ovpn/netlink-gen.c:52:\t[OVPN_A_KEYCONF_SLOT] = NLA_POLICY_MAX(NLA_U32, 1),\ndrivers/net/ovpn/netlink-gen.c:53:\t[OVPN_A_KEYCONF_KEY_ID] = NLA_POLICY_MAX(NLA_U32, 7),\ndrivers/net/ovpn/netlink-gen.c:54:\t[OVPN_A_KEYCONF_CIPHER_ALG] = NLA_POLICY_MAX(NLA_U32, 2),\ndrivers/net/ovpn/netlink-gen.c-55-};\ndrivers/net/ovpn/netlink-gen.c-56-\ndrivers/net/ovpn/netlink-gen.c:57:const struct nla_policy ovpn_keyconf_swap_input_nl_policy[OVPN_A_KEYCONF_PEER_ID + 1] = {\ndrivers/net/ovpn/netlink-gen.c:58:\t[OVPN_A_KEYCONF_PEER_ID] = NLA_POLICY_FULL_RANGE(NLA_U32, \u0026ovpn_a_keyconf_peer_id_range),\ndrivers/net/ovpn/netlink-gen.c-59-};\ndrivers/net/ovpn/netlink-gen.c-60-\ndrivers/net/ovpn/netlink-gen.c:61:const struct nla_policy ovpn_keydir_nl_policy[OVPN_A_KEYDIR_NONCE_TAIL + 1] = {\ndrivers/net/ovpn/netlink-gen.c:62:\t[OVPN_A_KEYDIR_CIPHER_KEY] = NLA_POLICY_MAX_LEN(256),\ndrivers/net/ovpn/netlink-gen.c:63:\t[OVPN_A_KEYDIR_NONCE_TAIL] = NLA_POLICY_EXACT_LEN(OVPN_NONCE_TAIL_SIZE),\ndrivers/net/ovpn/netlink-gen.c-64-};\ndrivers/net/ovpn/netlink-gen.c-65-\ndrivers/net/ovpn/netlink-gen.c:66:const struct nla_policy ovpn_peer_nl_policy[OVPN_A_PEER_TX_ID + 1] = {\ndrivers/net/ovpn/netlink-gen.c:67:\t[OVPN_A_PEER_ID] = NLA_POLICY_FULL_RANGE(NLA_U32, \u0026ovpn_a_peer_id_range),\ndrivers/net/ovpn/netlink-gen.c:68:\t[OVPN_A_PEER_REMOTE_IPV4] = { .type = NLA_BE32, },\ndrivers/net/ovpn/netlink-gen.c:69:\t[OVPN_A_PEER_REMOTE_IPV6] = NLA_POLICY_EXACT_LEN(16),\ndrivers/net/ovpn/netlink-gen.c:70:\t[OVPN_A_PEER_REMOTE_IPV6_SCOPE_ID] = { .type = NLA_U32, },\ndrivers/net/ovpn/netlink-gen.c:71:\t[OVPN_A_PEER_REMOTE_PORT] = NLA_POLICY_MIN(NLA_BE16, 1),\ndrivers/net/ovpn/netlink-gen.c:72:\t[OVPN_A_PEER_SOCKET] = { .type = NLA_U32, },\ndrivers/net/ovpn/netlink-gen.c:73:\t[OVPN_A_PEER_SOCKET_NETNSID] = { .type = NLA_S32, },\ndrivers/net/ovpn/netlink-gen.c:74:\t[OVPN_A_PEER_VPN_IPV4] = { .type = NLA_BE32, },\ndrivers/net/ovpn/netlink-gen.c:75:\t[OVPN_A_PEER_VPN_IPV6] = NLA_POLICY_EXACT_LEN(16),\ndrivers/net/ovpn/netlink-gen.c:76:\t[OVPN_A_PEER_LOCAL_IPV4] = { .type = NLA_BE32, },\ndrivers/net/ovpn/netlink-gen.c:77:\t[OVPN_A_PEER_LOCAL_IPV6] = NLA_POLICY_EXACT_LEN(16),\ndrivers/net/ovpn/netlink-gen.c:78:\t[OVPN_A_PEER_LOCAL_PORT] = NLA_POLICY_MIN(NLA_BE16, 1),\ndrivers/net/ovpn/netlink-gen.c:79:\t[OVPN_A_PEER_KEEPALIVE_INTERVAL] = NLA_POLICY_FULL_RANGE(NLA_U32, \u0026ovpn_a_peer_keepalive_interval_range),\ndrivers/net/ovpn/netlink-gen.c:80:\t[OVPN_A_PEER_KEEPALIVE_TIMEOUT] = NLA_POLICY_FULL_RANGE(NLA_U32, \u0026ovpn_a_peer_keepalive_timeout_range),\ndrivers/net/ovpn/netlink-gen.c:81:\t[OVPN_A_PEER_DEL_REASON] = NLA_POLICY_MAX(NLA_U32, 4),\ndrivers/net/ovpn/netlink-gen.c:82:\t[OVPN_A_PEER_VPN_RX_BYTES] = { .type = NLA_UINT, },\ndrivers/net/ovpn/netlink-gen.c:83:\t[OVPN_A_PEER_VPN_TX_BYTES] = { .type = NLA_UINT, },\ndrivers/net/ovpn/netlink-gen.c:84:\t[OVPN_A_PEER_VPN_RX_PACKETS] = { .type = NLA_UINT, },\ndrivers/net/ovpn/netlink-gen.c:85:\t[OVPN_A_PEER_VPN_TX_PACKETS] = { .type = NLA_UINT, },\ndrivers/net/ovpn/netlink-gen.c:86:\t[OVPN_A_PEER_LINK_RX_BYTES] = { .type = NLA_UINT, },\ndrivers/net/ovpn/netlink-gen.c:87:\t[OVPN_A_PEER_LINK_TX_BYTES] = { .type = NLA_UINT, },\ndrivers/net/ovpn/netlink-gen.c:88:\t[OVPN_A_PEER_LINK_RX_PACKETS] = { .type = NLA_UINT, },\ndrivers/net/ovpn/netlink-gen.c:89:\t[OVPN_A_PEER_LINK_TX_PACKETS] = { .type = NLA_UINT, },\ndrivers/net/ovpn/netlink-gen.c:90:\t[OVPN_A_PEER_TX_ID] = NLA_POLICY_FULL_RANGE(NLA_U32, \u0026ovpn_a_peer_tx_id_range),\ndrivers/net/ovpn/netlink-gen.c-91-};\ndrivers/net/ovpn/netlink-gen.c-92-\ndrivers/net/ovpn/netlink-gen.c:93:const struct nla_policy ovpn_peer_del_input_nl_policy[OVPN_A_PEER_ID + 1] = {\ndrivers/net/ovpn/netlink-gen.c:94:\t[OVPN_A_PEER_ID] = NLA_POLICY_FULL_RANGE(NLA_U32, \u0026ovpn_a_peer_id_range),\ndrivers/net/ovpn/netlink-gen.c-95-};\ndrivers/net/ovpn/netlink-gen.c-96-\ndrivers/net/ovpn/netlink-gen.c:97:const struct nla_policy ovpn_peer_new_input_nl_policy[OVPN_A_PEER_TX_ID + 1] = {\ndrivers/net/ovpn/netlink-gen.c:98:\t[OVPN_A_PEER_ID] = NLA_POLICY_FULL_RANGE(NLA_U32, \u0026ovpn_a_peer_id_range),\ndrivers/net/ovpn/netlink-gen.c:99:\t[OVPN_A_PEER_REMOTE_IPV4] = { .type = NLA_BE32, },\ndrivers/net/ovpn/netlink-gen.c:100:\t[OVPN_A_PEER_REMOTE_IPV6] = NLA_POLICY_EXACT_LEN(16),\ndrivers/net/ovpn/netlink-gen.c:101:\t[OVPN_A_PEER_REMOTE_IPV6_SCOPE_ID] = { .type = NLA_U32, },\ndrivers/net/ovpn/netlink-gen.c:102:\t[OVPN_A_PEER_REMOTE_PORT] = NLA_POLICY_MIN(NLA_BE16, 1),\ndrivers/net/ovpn/netlink-gen.c:103:\t[OVPN_A_PEER_SOCKET] = { .type = NLA_U32, },\ndrivers/net/ovpn/netlink-gen.c:104:\t[OVPN_A_PEER_VPN_IPV4] = { .type = NLA_BE32, },\ndrivers/net/ovpn/netlink-gen.c:105:\t[OVPN_A_PEER_VPN_IPV6] = NLA_POLICY_EXACT_LEN(16),\ndrivers/net/ovpn/netlink-gen.c:106:\t[OVPN_A_PEER_LOCAL_IPV4] = { .type = NLA_BE32, },\ndrivers/net/ovpn/netlink-gen.c:107:\t[OVPN_A_PEER_LOCAL_IPV6] = NLA_POLICY_EXACT_LEN(16),\ndrivers/net/ovpn/netlink-gen.c:108:\t[OVPN_A_PEER_KEEPALIVE_INTERVAL] = NLA_POLICY_FULL_RANGE(NLA_U32, \u0026ovpn_a_peer_keepalive_interval_range),\ndrivers/net/ovpn/netlink-gen.c:109:\t[OVPN_A_PEER_KEEPALIVE_TIMEOUT] = NLA_POLICY_FULL_RANGE(NLA_U32, \u0026ovpn_a_peer_keepalive_timeout_range),\ndrivers/net/ovpn/netlink-gen.c:110:\t[OVPN_A_PEER_TX_ID] = NLA_POLICY_FULL_RANGE(NLA_U32, \u0026ovpn_a_peer_tx_id_range),\ndrivers/net/ovpn/netlink-gen.c-111-};\ndrivers/net/ovpn/netlink-gen.c-112-\ndrivers/net/ovpn/netlink-gen.c:113:const struct nla_policy ovpn_peer_set_input_nl_policy[OVPN_A_PEER_TX_ID + 1] = {\ndrivers/net/ovpn/netlink-gen.c:114:\t[OVPN_A_PEER_ID] = NLA_POLICY_FULL_RANGE(NLA_U32, \u0026ovpn_a_peer_id_range),\ndrivers/net/ovpn/netlink-gen.c:115:\t[OVPN_A_PEER_REMOTE_IPV4] = { .type = NLA_BE32, },\ndrivers/net/ovpn/netlink-gen.c:116:\t[OVPN_A_PEER_REMOTE_IPV6] = NLA_POLICY_EXACT_LEN(16),\ndrivers/net/ovpn/netlink-gen.c:117:\t[OVPN_A_PEER_REMOTE_IPV6_SCOPE_ID] = { .type = NLA_U32, },\ndrivers/net/ovpn/netlink-gen.c:118:\t[OVPN_A_PEER_REMOTE_PORT] = NLA_POLICY_MIN(NLA_BE16, 1),\ndrivers/net/ovpn/netlink-gen.c:119:\t[OVPN_A_PEER_VPN_IPV4] = { .type = NLA_BE32, },\ndrivers/net/ovpn/netlink-gen.c:120:\t[OVPN_A_PEER_VPN_IPV6] = NLA_POLICY_EXACT_LEN(16),\ndrivers/net/ovpn/netlink-gen.c:121:\t[OVPN_A_PEER_LOCAL_IPV4] = { .type = NLA_BE32, },\ndrivers/net/ovpn/netlink-gen.c:122:\t[OVPN_A_PEER_LOCAL_IPV6] = NLA_POLICY_EXACT_LEN(16),\ndrivers/net/ovpn/netlink-gen.c:123:\t[OVPN_A_PEER_KEEPALIVE_INTERVAL] = NLA_POLICY_FULL_RANGE(NLA_U32, \u0026ovpn_a_peer_keepalive_interval_range),\ndrivers/net/ovpn/netlink-gen.c:124:\t[OVPN_A_PEER_KEEPALIVE_TIMEOUT] = NLA_POLICY_FULL_RANGE(NLA_U32, \u0026ovpn_a_peer_keepalive_timeout_range),\ndrivers/net/ovpn/netlink-gen.c:125:\t[OVPN_A_PEER_TX_ID] = NLA_POLICY_FULL_RANGE(NLA_U32, \u0026ovpn_a_peer_tx_id_range),\ndrivers/net/ovpn/netlink-gen.c-126-};\ndrivers/net/ovpn/netlink-gen.c-127-\ndrivers/net/ovpn/netlink-gen.c:128:/* OVPN_CMD_PEER_NEW - do */\ndrivers/net/ovpn/netlink-gen.c:129:static const struct nla_policy ovpn_peer_new_nl_policy[OVPN_A_PEER + 1] = {\ndrivers/net/ovpn/netlink-gen.c:130:\t[OVPN_A_IFINDEX] = { .type = NLA_U32, },\ndrivers/net/ovpn/netlink-gen.c:131:\t[OVPN_A_PEER] = NLA_POLICY_NESTED(ovpn_peer_new_input_nl_policy),\ndrivers/net/ovpn/netlink-gen.c-132-};\ndrivers/net/ovpn/netlink-gen.c-133-\ndrivers/net/ovpn/netlink-gen.c:134:/* OVPN_CMD_PEER_SET - do */\ndrivers/net/ovpn/netlink-gen.c:135:static const struct nla_policy ovpn_peer_set_nl_policy[OVPN_A_PEER + 1] = {\ndrivers/net/ovpn/netlink-gen.c:136:\t[OVPN_A_IFINDEX] = { .type = NLA_U32, },\ndrivers/net/ovpn/netlink-gen.c:137:\t[OVPN_A_PEER] = NLA_POLICY_NESTED(ovpn_peer_set_input_nl_policy),\ndrivers/net/ovpn/netlink-gen.c-138-};\ndrivers/net/ovpn/netlink-gen.c-139-\ndrivers/net/ovpn/netlink-gen.c:140:/* OVPN_CMD_PEER_GET - do */\ndrivers/net/ovpn/netlink-gen.c:141:static const struct nla_policy ovpn_peer_get_do_nl_policy[OVPN_A_PEER + 1] = {\ndrivers/net/ovpn/netlink-gen.c:142:\t[OVPN_A_IFINDEX] = { .type = NLA_U32, },\ndrivers/net/ovpn/netlink-gen.c:143:\t[OVPN_A_PEER] = NLA_POLICY_NESTED(ovpn_peer_nl_policy),\ndrivers/net/ovpn/netlink-gen.c-144-};\ndrivers/net/ovpn/netlink-gen.c-145-\ndrivers/net/ovpn/netlink-gen.c:146:/* OVPN_CMD_PEER_GET - dump */\ndrivers/net/ovpn/netlink-gen.c:147:static const struct nla_policy ovpn_peer_get_dump_nl_policy[OVPN_A_IFINDEX + 1] = {\ndrivers/net/ovpn/netlink-gen.c:148:\t[OVPN_A_IFINDEX] = { .type = NLA_U32, },\ndrivers/net/ovpn/netlink-gen.c-149-};\ndrivers/net/ovpn/netlink-gen.c-150-\ndrivers/net/ovpn/netlink-gen.c:151:/* OVPN_CMD_PEER_DEL - do */\ndrivers/net/ovpn/netlink-gen.c:152:static const struct nla_policy ovpn_peer_del_nl_policy[OVPN_A_PEER + 1] = {\ndrivers/net/ovpn/netlink-gen.c:153:\t[OVPN_A_IFINDEX] = { .type = NLA_U32, },\ndrivers/net/ovpn/netlink-gen.c:154:\t[OVPN_A_PEER] = NLA_POLICY_NESTED(ovpn_peer_del_input_nl_policy),\ndrivers/net/ovpn/netlink-gen.c-155-};\ndrivers/net/ovpn/netlink-gen.c-156-\ndrivers/net/ovpn/netlink-gen.c:157:/* OVPN_CMD_KEY_NEW - do */\ndrivers/net/ovpn/netlink-gen.c:158:static const struct nla_policy ovpn_key_new_nl_policy[OVPN_A_KEYCONF + 1] = {\ndrivers/net/ovpn/netlink-gen.c:159:\t[OVPN_A_IFINDEX] = { .type = NLA_U32, },\ndrivers/net/ovpn/netlink-gen.c:160:\t[OVPN_A_KEYCONF] = NLA_POLICY_NESTED(ovpn_keyconf_nl_policy),\ndrivers/net/ovpn/netlink-gen.c-161-};\ndrivers/net/ovpn/netlink-gen.c-162-\ndrivers/net/ovpn/netlink-gen.c:163:/* OVPN_CMD_KEY_GET - do */\ndrivers/net/ovpn/netlink-gen.c:164:static const struct nla_policy ovpn_key_get_nl_policy[OVPN_A_KEYCONF + 1] = {\ndrivers/net/ovpn/netlink-gen.c:165:\t[OVPN_A_IFINDEX] = { .type = NLA_U32, },\ndrivers/net/ovpn/netlink-gen.c:166:\t[OVPN_A_KEYCONF] = NLA_POLICY_NESTED(ovpn_keyconf_get_nl_policy),\ndrivers/net/ovpn/netlink-gen.c-167-};\ndrivers/net/ovpn/netlink-gen.c-168-\ndrivers/net/ovpn/netlink-gen.c:169:/* OVPN_CMD_KEY_SWAP - do */\ndrivers/net/ovpn/netlink-gen.c:170:static const struct nla_policy ovpn_key_swap_nl_policy[OVPN_A_KEYCONF + 1] = {\ndrivers/net/ovpn/netlink-gen.c:171:\t[OVPN_A_IFINDEX] = { .type = NLA_U32, },\ndrivers/net/ovpn/netlink-gen.c:172:\t[OVPN_A_KEYCONF] = NLA_POLICY_NESTED(ovpn_keyconf_swap_input_nl_policy),\ndrivers/net/ovpn/netlink-gen.c-173-};\ndrivers/net/ovpn/netlink-gen.c-174-\ndrivers/net/ovpn/netlink-gen.c:175:/* OVPN_CMD_KEY_DEL - do */\ndrivers/net/ovpn/netlink-gen.c:176:static const struct nla_policy ovpn_key_del_nl_policy[OVPN_A_KEYCONF + 1] = {\ndrivers/net/ovpn/netlink-gen.c:177:\t[OVPN_A_IFINDEX] = { .type = NLA_U32, },\ndrivers/net/ovpn/netlink-gen.c:178:\t[OVPN_A_KEYCONF] = NLA_POLICY_NESTED(ovpn_keyconf_del_input_nl_policy),\ndrivers/net/ovpn/netlink-gen.c-179-};\n--\ndrivers/net/ovpn/netlink-gen.c=182=static const struct genl_split_ops ovpn_nl_ops[] = {\ndrivers/net/ovpn/netlink-gen.c-183-\t{\ndrivers/net/ovpn/netlink-gen.c:184:\t\t.cmd\t\t= OVPN_CMD_PEER_NEW,\ndrivers/net/ovpn/netlink-gen.c-185-\t\t.pre_doit\t= ovpn_nl_pre_doit,\n--\ndrivers/net/ovpn/netlink-gen.c-188-\t\t.policy\t\t= ovpn_peer_new_nl_policy,\ndrivers/net/ovpn/netlink-gen.c:189:\t\t.maxattr\t= OVPN_A_PEER,\ndrivers/net/ovpn/netlink-gen.c-190-\t\t.flags\t\t= GENL_ADMIN_PERM | GENL_CMD_CAP_DO,\n--\ndrivers/net/ovpn/netlink-gen.c-192-\t{\ndrivers/net/ovpn/netlink-gen.c:193:\t\t.cmd\t\t= OVPN_CMD_PEER_SET,\ndrivers/net/ovpn/netlink-gen.c-194-\t\t.pre_doit\t= ovpn_nl_pre_doit,\n--\ndrivers/net/ovpn/netlink-gen.c-197-\t\t.policy\t\t= ovpn_peer_set_nl_policy,\ndrivers/net/ovpn/netlink-gen.c:198:\t\t.maxattr\t= OVPN_A_PEER,\ndrivers/net/ovpn/netlink-gen.c-199-\t\t.flags\t\t= GENL_ADMIN_PERM | GENL_CMD_CAP_DO,\n--\ndrivers/net/ovpn/netlink-gen.c-201-\t{\ndrivers/net/ovpn/netlink-gen.c:202:\t\t.cmd\t\t= OVPN_CMD_PEER_GET,\ndrivers/net/ovpn/netlink-gen.c-203-\t\t.pre_doit\t= ovpn_nl_pre_doit,\n--\ndrivers/net/ovpn/netlink-gen.c-206-\t\t.policy\t\t= ovpn_peer_get_do_nl_policy,\ndrivers/net/ovpn/netlink-gen.c:207:\t\t.maxattr\t= OVPN_A_PEER,\n\n"
} |
| 21/2 | 2026/09/24 07:58 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 44233 output: 35 thoughts: 23 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience: **Investigating the OpenVPN Kconfig Configuration** Alright, let's get down to brass tacks. I need to understand the configuration options and dependencies associated with the OpenVPN driver. My first instinct, as always, is to dive right into the source code, specifically `drivers/net/ovpn/Kconfig`. That's where I'll find the definitive answers. I'm expecting to see the `CONFIG_` symbol defined there, along with all the relevant `depends on` statements. I want to see what other features, drivers, or kernel configurations need to be in place before OpenVPN support can be enabled. I need a clear picture of its integration into the broader networking stack. I'll be looking for any non-obvious dependencies or potential conflicts that I might need to consider down the line. It's time to become intimate with the Kconfig details. |
| 22/2 | 2026/09/24 07:59 | tool | read-file |
0mError:the file does not exist Args: {
"File": "drivers/net/ovpn/Kconfig",
"FirstLine": 1,
"LineCount": 40
}Results: {
"error": "the file does not exist"
} |
| 23/2 | 2026/09/24 07:59 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 44511 output: 34 thoughts: 28 Thoughts: Okay, let's dive into this. Here's my thought process on the matter: **Navigating the Kconfig Landscape** Right, so I need to retrace my steps, or at least solidify my mental map. Let's see... based on the previous investigation, I recall that `config OVPN` - that OpenVPN configuration option - was located in `drivers/net/Kconfig`. I'm going to quickly re-check line 103 within that file. That's a reasonable place to start, given that I'm trying to refine my understanding of this. |
| 24/2 | 2026/09/24 07:59 | tool | read-file |
0mArgs:{
"File": "drivers/net/Kconfig",
"FirstLine": 100,
"LineCount": 40
}Results: {
"Contents": " 100:\t\n 101:\t\t Say N here unless you know what you're doing.\n 102:\t\n 103:\tconfig OVPN\n 104:\t\ttristate \"OpenVPN data channel offload\"\n 105:\t\tdepends on NET \u0026\u0026 INET\n 106:\t\tselect DST_CACHE\n 107:\t\tselect NET_UDP_TUNNEL\n 108:\t\tselect CRYPTO\n 109:\t\tselect CRYPTO_AES\n 110:\t\tselect CRYPTO_GCM\n 111:\t\tselect CRYPTO_CHACHA20POLY1305\n 112:\t\tselect STREAM_PARSER\n 113:\t\thelp\n 114:\t\t This module enhances the performance of the OpenVPN userspace software\n 115:\t\t by offloading the data channel processing to kernelspace.\n 116:\t\n 117:\tconfig EQUALIZER\n 118:\t\ttristate \"EQL (serial line load balancing) support\"\n 119:\t\thelp\n 120:\t\t If you have two serial connections to some other computer (this\n 121:\t\t usually requires two modems and two telephone lines) and you use\n 122:\t\t SLIP (the protocol for sending Internet traffic over telephone\n 123:\t\t lines) or PPP (a better SLIP) on them, you can make them behave like\n 124:\t\t one double speed connection using this driver. Naturally, this has\n 125:\t\t to be supported at the other end as well, either with a similar EQL\n 126:\t\t Linux driver or with a Livingston Portmaster 2e.\n 127:\t\n 128:\t\t Say Y if you want this and read\n 129:\t\t \u003cfile:Documentation/networking/eql.rst\u003e. You may also want to read\n 130:\t\t section 6.2 of the NET-3-HOWTO, available from\n 131:\t\t \u003chttp://www.tldp.org/docs.html#howto\u003e.\n 132:\t\n 133:\t\t To compile this driver as a module, choose M here: the module\n 134:\t\t will be called eql. If unsure, say N.\n 135:\t\n 136:\tconfig NET_FC\n 137:\t\tbool \"Fibre Channel driver support\"\n 138:\t\tdepends on SCSI \u0026\u0026 PCI\n 139:\t\thelp\n"
} |
| 25/2 | 2026/09/24 07:59 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 45327 output: 37 thoughts: 311 Thoughts: **My Initial Thoughts on the New OpenVPN Data Channel Offload (ovpn-dco) in the Linux Kernel** Okay, so `config OVPN` relies on `NET && INET`. Makes sense. Now, what's this `OVPN` thing exactly? Ah, right, it's the new OpenVPN data channel offload, `ovpn-dco`, recently merged into the upstream kernel. Intriguing! So it's a virtual network device driver, utilizing `rtnl_link_ops`, created via `rtnl` or generic netlink (`ovpn_nl_ops`). Essentially, it's fully emulated, just like WireGuard or tun/tap. That's good. Now, my mind goes straight to fuzzing. Can syzkaller get its hands on this? Absolutely! Syzkaller is all over netlink, network devices, `rtnl`, `genl`, sockets – this is definitely within its wheelhouse. It is all there and accessible. Now, let's dive into the actual code changes to get a better sense of what's happening under the hood. I need to know how the code is being utilized. My first thought is to check `drivers/net/ovpn/bind.c`. I found some minor changes, so let's make sure the function body of `ovpn_bind_from_sockaddr` didn't change at all! I'm curious. |
| 26/2 | 2026/09/24 07:59 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/bind.c",
"FirstLine": 18,
"LineCount": 35
}Results: {
"Contents": " 18:\t * ovpn_bind_from_sockaddr - retrieve binding matching sockaddr\n 19:\t * @ss: the sockaddr to match\n 20:\t *\n 21:\t * Return: the new bind for the passed sockaddr, an ERR_PTR() on failure\n 22:\t */\n 23:\tstruct ovpn_bind *ovpn_bind_from_sockaddr(const struct sockaddr_storage *ss)\n 24:\t{\n 25:\t\tstruct ovpn_bind *bind;\n 26:\t\tsize_t sa_len;\n 27:\t\n 28:\t\tif (ss-\u003ess_family == AF_INET)\n 29:\t\t\tsa_len = sizeof(struct sockaddr_in);\n 30:\t\telse if (ss-\u003ess_family == AF_INET6)\n 31:\t\t\tsa_len = sizeof(struct sockaddr_in6);\n 32:\t\telse\n 33:\t\t\treturn ERR_PTR(-EAFNOSUPPORT);\n 34:\t\n 35:\t\tbind = kzalloc_obj(*bind, GFP_ATOMIC);\n 36:\t\tif (unlikely(!bind))\n 37:\t\t\treturn ERR_PTR(-ENOMEM);\n 38:\t\n 39:\t\tmemcpy(\u0026bind-\u003eremote, ss, sa_len);\n 40:\t\n 41:\t\treturn bind;\n 42:\t}\n 43:\t\n 44:\t/**\n 45:\t * ovpn_bind_reset - assign new binding to peer\n 46:\t * @peer: the peer whose binding has to be replaced\n 47:\t * @new: the new bind to assign\n 48:\t */\n 49:\tvoid ovpn_bind_reset(struct ovpn_peer *peer, struct ovpn_bind *new)\n 50:\t{\n 51:\t\tlockdep_assert_held(\u0026peer-\u003elock);\n 52:\t\n"
} |
| 27/2 | 2026/09/24 07:59 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 46466 output: 39 thoughts: 231 Thoughts: **Analyzing a Potential Null Pointer Dereference** Okay, here's what's going through my mind as I look at this code. I see this diff, specifically the removal of the `if (likely(peer))` check before the `ovpn_peer_put(peer)` call in `ovpn_decrypt_post` and `ovpn_encrypt_post`. My initial reaction is, "Wait a minute, is that safe?" The code assumes `peer` is never NULL after this change. I have to verify that assumption. The problem, as I see it, is that `ovpn_peer_put` likely performs a `kref_put` on `peer->refcount`. If `peer` IS NULL, the dereference of `peer` will lead to a null pointer dereference, a classic and catastrophic bug. So, I need to figure out how `peer` is used here. I need to trace back from `ovpn_skb_cb(skb)->peer` to find all places where the `peer` variable is set. My main concern is to determine if there's any pathway through the code where the functions `ovpn_decrypt_post` or `ovpn_encrypt_post` can be called with `peer` already being NULL, which would trigger this critical vulnerability. I need to be completely sure of the call contexts of these functions. Time to dig deeper into the code. |
| 28/2 | 2026/09/24 07:59 | tool | grepper |
0mArgs:{
"Expression": "ovpn_decrypt_post|ovpn_encrypt_post",
"PathPrefix": "drivers/net/ovpn"
}Results: {
"Output": "drivers/net/ovpn/crypto_aead.c=138=int ovpn_aead_encrypt(struct ovpn_peer *peer, struct ovpn_crypto_key_slot *ks,\n--\ndrivers/net/ovpn/crypto_aead.c-231-\taead_request_set_tfm(req, ks-\u003eencrypt);\ndrivers/net/ovpn/crypto_aead.c:232:\taead_request_set_callback(req, 0, ovpn_encrypt_post, skb);\ndrivers/net/ovpn/crypto_aead.c-233-\taead_request_set_crypt(req, sg, sg,\n--\ndrivers/net/ovpn/crypto_aead.c=241=int ovpn_aead_decrypt(struct ovpn_peer *peer, struct ovpn_crypto_key_slot *ks,\n--\ndrivers/net/ovpn/crypto_aead.c-318-\taead_request_set_tfm(req, ks-\u003edecrypt);\ndrivers/net/ovpn/crypto_aead.c:319:\taead_request_set_callback(req, 0, ovpn_decrypt_post, skb);\ndrivers/net/ovpn/crypto_aead.c-320-\taead_request_set_crypt(req, sg, sg, payload_len + tag_size, iv);\n--\ndrivers/net/ovpn/io.c=60=static void ovpn_netdev_write(struct ovpn_peer *peer, struct sk_buff *skb)\n--\ndrivers/net/ovpn/io.c-86-\ndrivers/net/ovpn/io.c:87:\t/* network header reset in ovpn_decrypt_post() */\ndrivers/net/ovpn/io.c-88-\tskb_reset_mac_header(skb);\n--\ndrivers/net/ovpn/io.c-107-\ndrivers/net/ovpn/io.c:108:void ovpn_decrypt_post(void *data, int ret)\ndrivers/net/ovpn/io.c-109-{\n--\ndrivers/net/ovpn/io.c=213=void ovpn_recv(struct ovpn_peer *peer, struct sk_buff *skb)\n--\ndrivers/net/ovpn/io.c-233-\tmemset(ovpn_skb_cb(skb), 0, sizeof(struct ovpn_cb));\ndrivers/net/ovpn/io.c:234:\tovpn_decrypt_post(skb, ovpn_aead_decrypt(peer, ks, skb));\ndrivers/net/ovpn/io.c-235-}\ndrivers/net/ovpn/io.c-236-\ndrivers/net/ovpn/io.c:237:void ovpn_encrypt_post(void *data, int ret)\ndrivers/net/ovpn/io.c-238-{\n--\ndrivers/net/ovpn/io.c=310=static bool ovpn_encrypt_one(struct ovpn_peer *peer, struct sk_buff *skb)\n--\ndrivers/net/ovpn/io.c-319-\t/* take a reference to the peer because the crypto code may run async.\ndrivers/net/ovpn/io.c:320:\t * ovpn_encrypt_post() will release it upon completion\ndrivers/net/ovpn/io.c-321-\t */\n--\ndrivers/net/ovpn/io.c-328-\tmemset(ovpn_skb_cb(skb), 0, sizeof(struct ovpn_cb));\ndrivers/net/ovpn/io.c:329:\tovpn_encrypt_post(skb, ovpn_aead_encrypt(peer, ks, skb));\ndrivers/net/ovpn/io.c-330-\treturn true;\n--\ndrivers/net/ovpn/io.h=28=void ovpn_xmit_special(struct ovpn_peer *peer, const void *data,\n--\ndrivers/net/ovpn/io.h-30-\ndrivers/net/ovpn/io.h:31:void ovpn_encrypt_post(void *data, int ret);\ndrivers/net/ovpn/io.h:32:void ovpn_decrypt_post(void *data, int ret);\ndrivers/net/ovpn/io.h-33-\n"
} |
| 29/2 | 2026/09/24 07:59 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 48138 output: 38 thoughts: 48 Thoughts: Okay, here's my take on those lines of code – let's see what we're dealing with. **Diving into `drivers/net/ovpn/io.c`** Alright, my first thought is to zero in on lines 220-236 and then 310-333 in `drivers/net/ovpn/io.c`. Based on the file path, this is likely where the OpenVPN driver's input/output operations are handled. I need to get a clear picture of how data is read and written, and potential bottlenecks or security vulnerabilities in this section. I want to understand the control flow, error handling, and any synchronization mechanisms in place within those specific blocks of code. I am particularly looking at how they interact with the network stack. I know from experience that this is where we will find common issues such as buffer overflows or inefficient data handling. I'll be paying close attention to any system calls and memory management within those regions. |
| 30/2 | 2026/09/24 07:59 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/io.c",
"FirstLine": 220,
"LineCount": 25
}Results: {
"Contents": " 220:\t\t/* get the key slot matching the key ID in the received packet */\n 221:\t\tkey_id = ovpn_key_id_from_skb(skb);\n 222:\t\tks = ovpn_crypto_key_id_to_slot(\u0026peer-\u003ecrypto, key_id);\n 223:\t\tif (unlikely(!ks)) {\n 224:\t\t\tnet_info_ratelimited(\"%s: no available key for peer %u, key-id: %u\\n\",\n 225:\t\t\t\t\t netdev_name(peer-\u003eovpn-\u003edev), peer-\u003eid,\n 226:\t\t\t\t\t key_id);\n 227:\t\t\tovpn_dev_dstats_rx_dropped(peer-\u003eovpn-\u003edev);\n 228:\t\t\tkfree_skb(skb);\n 229:\t\t\tovpn_peer_put(peer);\n 230:\t\t\treturn;\n 231:\t\t}\n 232:\t\n 233:\t\tmemset(ovpn_skb_cb(skb), 0, sizeof(struct ovpn_cb));\n 234:\t\tovpn_decrypt_post(skb, ovpn_aead_decrypt(peer, ks, skb));\n 235:\t}\n 236:\t\n 237:\tvoid ovpn_encrypt_post(void *data, int ret)\n 238:\t{\n 239:\t\tstruct ovpn_crypto_key_slot *ks;\n 240:\t\tstruct sk_buff *skb = data;\n 241:\t\tstruct ovpn_socket *sock;\n 242:\t\tstruct ovpn_peer *peer;\n 243:\t\tunsigned int orig_len;\n 244:\t\n"
} |
| 31/2 | 2026/09/24 07:59 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 48886 output: 41 thoughts: 127 Thoughts: Okay, let's break this down. **Diving into the OpenVPN AEAD Decryption** Alright, so I'm looking at this bit of code: `memset(ovpn_skb_cb(skb), 0, sizeof(struct ovpn_cb));` and then `ovpn_decrypt_post(skb, ovpn_aead_decrypt(peer, ks, skb));`. I see the `ovpn_aead_decrypt` function call right there and that `ovpn_decrypt_post` seems to be handling the final steps. But wait, a crucial question arises – what's the control flow *inside* `ovpn_aead_decrypt` if the decryption process hits a snag or exits early? That's the critical point I need to nail down. Is the packet handled correctly, or could this leave the program vulnerable? This could have all sorts of implications. I need to understand *exactly* how `ovpn_aead_decrypt` behaves in error scenarios. I'm going to jump over to `drivers/net/ovpn/crypto_aead.c` to see how it's implemented. Gotta trace the path and verify the handling of any failure conditions. My main concern is that it doesn't leave the SKB in an unrecoverable state. |
| 32/2 | 2026/09/24 07:59 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/crypto_aead.c",
"FirstLine": 240,
"LineCount": 80
}Results: {
"Contents": " 240:\t\n 241:\tint ovpn_aead_decrypt(struct ovpn_peer *peer, struct ovpn_crypto_key_slot *ks,\n 242:\t\t\t struct sk_buff *skb)\n 243:\t{\n 244:\t\tconst unsigned int tag_size = crypto_aead_authsize(ks-\u003edecrypt);\n 245:\t\tint ret, payload_len, nfrags;\n 246:\t\tunsigned int payload_offset;\n 247:\t\tstruct aead_request *req;\n 248:\t\tstruct sk_buff *trailer;\n 249:\t\tstruct scatterlist *sg;\n 250:\t\tvoid *tmp;\n 251:\t\tu8 *iv;\n 252:\t\n 253:\t\tpayload_offset = OVPN_AAD_SIZE + tag_size;\n 254:\t\tpayload_len = skb-\u003elen - payload_offset;\n 255:\t\n 256:\t\tovpn_skb_cb(skb)-\u003epayload_offset = payload_offset;\n 257:\t\tovpn_skb_cb(skb)-\u003epeer = peer;\n 258:\t\tovpn_skb_cb(skb)-\u003eks = ks;\n 259:\t\n 260:\t\t/* sanity check on packet size, payload size must be \u003e= 0 */\n 261:\t\tif (unlikely(payload_len \u003c 0))\n 262:\t\t\treturn -EINVAL;\n 263:\t\n 264:\t\t/* Prepare the skb data buffer to be accessed up until the auth tag.\n 265:\t\t * This is required because this area is directly mapped into the sg\n 266:\t\t * list.\n 267:\t\t */\n 268:\t\tif (unlikely(!pskb_may_pull(skb, payload_offset)))\n 269:\t\t\treturn -ENODATA;\n 270:\t\n 271:\t\t/* get number of skb frags and ensure that packet data is writable */\n 272:\t\tnfrags = skb_cow_data(skb, 0, \u0026trailer);\n 273:\t\tif (unlikely(nfrags \u003c 0))\n 274:\t\t\treturn nfrags;\n 275:\t\n 276:\t\tif (unlikely(nfrags + 2 \u003e (MAX_SKB_FRAGS + 2)))\n 277:\t\t\treturn -ENOSPC;\n 278:\t\n 279:\t\t/* allocate temporary memory for iv, sg and req */\n 280:\t\ttmp = kmalloc(ovpn_aead_crypto_tmp_size(ks-\u003edecrypt, nfrags),\n 281:\t\t\t GFP_ATOMIC);\n 282:\t\tif (unlikely(!tmp))\n 283:\t\t\treturn -ENOMEM;\n 284:\t\n 285:\t\tovpn_skb_cb(skb)-\u003ecrypto_tmp = tmp;\n 286:\t\n 287:\t\tiv = ovpn_aead_crypto_tmp_iv(ks-\u003edecrypt, tmp);\n 288:\t\treq = ovpn_aead_crypto_tmp_req(ks-\u003edecrypt, iv);\n 289:\t\tsg = ovpn_aead_crypto_req_sg(ks-\u003edecrypt, req);\n 290:\t\n 291:\t\t/* sg table:\n 292:\t\t * 0: op, wire nonce (AD, len=OVPN_OPCODE_SIZE+OVPN_NONCE_WIRE_SIZE),\n 293:\t\t * 1, 2, 3, ..., n: payload,\n 294:\t\t * n+1: auth_tag (len=tag_size)\n 295:\t\t */\n 296:\t\tsg_init_table(sg, nfrags + 2);\n 297:\t\n 298:\t\t/* packet op is head of additional data */\n 299:\t\tsg_set_buf(sg, skb-\u003edata, OVPN_AAD_SIZE);\n 300:\t\n 301:\t\t/* build scatterlist to decrypt packet payload */\n 302:\t\tret = skb_to_sgvec_nomark(skb, sg + 1, payload_offset, payload_len);\n 303:\t\tif (unlikely(ret \u003c 0)) {\n 304:\t\t\tnetdev_err(peer-\u003eovpn-\u003edev,\n 305:\t\t\t\t \"decrypt: cannot map skb to sg: %d\\n\", ret);\n 306:\t\t\treturn ret;\n 307:\t\t}\n 308:\t\n 309:\t\t/* append auth_tag onto scatterlist */\n 310:\t\tsg_set_buf(sg + ret + 1, skb-\u003edata + OVPN_AAD_SIZE, tag_size);\n 311:\t\n 312:\t\t/* copy nonce into IV buffer */\n 313:\t\tmemcpy(iv, skb-\u003edata + OVPN_OPCODE_SIZE, OVPN_NONCE_WIRE_SIZE);\n 314:\t\tmemcpy(iv + OVPN_NONCE_WIRE_SIZE, ks-\u003enonce_tail_recv,\n 315:\t\t OVPN_NONCE_TAIL_SIZE);\n 316:\t\n 317:\t\t/* setup async crypto operation */\n 318:\t\taead_request_set_tfm(req, ks-\u003edecrypt);\n 319:\t\taead_request_set_callback(req, 0, ovpn_decrypt_post, skb);\n"
} |
| 33/2 | 2026/09/24 07:59 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 50745 output: 41 thoughts: 80 Thoughts: Okay, let's break this down. **Initial Impressions of OpenVPN Crypto Handlers** Alright, so diving into the OpenVPN code, specifically looking at the AEAD encryption and decryption routines. The first thing that jumps out is the assignment: `ovpn_skb_cb(skb)->peer = peer;`. This happens right at the beginning of the `ovpn_aead_decrypt` function. It's immediately setting the `peer` association within the `skb` control block. That's a key piece of metadata we need for decrypting correctly. It establishes the context, the remote end of the tunnel, right from the get-go. Now, let's shift gears to the encryption side. I'm going to quickly check lines 138-160 of `drivers/net/ovpn/crypto_aead.c`. I'll want to see how the code there handles encryption and where the `peer` is used to build the encrypted packet. The interplay between these two functions – encryption and decryption – is the core here, and I want to see how consistently that `peer` reference is being managed to ensure packet integrity and correct routing within the tunnel. Hopefully it's consistent and well-managed... inconsistent association of metadata would be a serious concern for security. |
| 34/2 | 2026/09/24 07:59 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/crypto_aead.c",
"FirstLine": 138,
"LineCount": 40
}Results: {
"Contents": " 138:\tint ovpn_aead_encrypt(struct ovpn_peer *peer, struct ovpn_crypto_key_slot *ks,\n 139:\t\t\t struct sk_buff *skb)\n 140:\t{\n 141:\t\tconst unsigned int tag_size = crypto_aead_authsize(ks-\u003eencrypt);\n 142:\t\tstruct aead_request *req;\n 143:\t\tstruct sk_buff *trailer;\n 144:\t\tstruct scatterlist *sg;\n 145:\t\tint nfrags, ret;\n 146:\t\tu32 pktid, op;\n 147:\t\tvoid *tmp;\n 148:\t\tu8 *iv;\n 149:\t\n 150:\t\tovpn_skb_cb(skb)-\u003epeer = peer;\n 151:\t\tovpn_skb_cb(skb)-\u003eks = ks;\n 152:\t\n 153:\t\t/* Sample AEAD header format:\n 154:\t\t * 48000001 00000005 7e7046bd 444a7e28 cc6387b1 64a4d6c1 380275a...\n 155:\t\t * [ OP32 ] [seq # ] [ auth tag ] [ payload ... ]\n 156:\t\t * [4-byte\n 157:\t\t * IV head]\n 158:\t\t */\n 159:\t\n 160:\t\t/* check that there's enough headroom in the skb for packet\n 161:\t\t * encapsulation\n 162:\t\t */\n 163:\t\tif (unlikely(skb_cow_head(skb, OVPN_HEAD_ROOM)))\n 164:\t\t\treturn -ENOBUFS;\n 165:\t\n 166:\t\t/* get number of skb frags and ensure that packet data is writable */\n 167:\t\tnfrags = skb_cow_data(skb, 0, \u0026trailer);\n 168:\t\tif (unlikely(nfrags \u003c 0))\n 169:\t\t\treturn nfrags;\n 170:\t\n 171:\t\tif (unlikely(nfrags + 2 \u003e (MAX_SKB_FRAGS + 2)))\n 172:\t\t\treturn -ENOSPC;\n 173:\t\n 174:\t\t/* allocate temporary memory for iv, sg and req */\n 175:\t\ttmp = kmalloc(ovpn_aead_crypto_tmp_size(ks-\u003eencrypt, nfrags),\n 176:\t\t\t GFP_ATOMIC);\n 177:\t\tif (unlikely(!tmp))\n"
} |
| 35/2 | 2026/09/24 07:59 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 51848 output: 36 thoughts: 398 Thoughts: **Analyzing the OpenVPN Netlink Implementation** Okay, let's dive into this `drivers/net/ovpn/netlink.c` code. Specifically, I need to understand what's happening with peer deletion notifications. So, `ovpn_nl_peer_del_notify` is the function of interest. It looks like it calls `ovpn_nl_fill_peer` with a `NULL` `genl_info` and a peer structure. Hold on a second... Let's take a closer look at `ovpn_nl_fill_peer`. This function is pivotal. I see a `rcu_read_lock` and the use of `rcu_dereference` to access the `sock` member of the `ovpn_peer` structure. Importantly, it checks if `sock` is valid, and handles cases where the net namespaces differ, using a `peernet2id_alloc` function. The code also retrieves the local port. However, a question pops into my mind: When is `ovpn_nl_peer_del_notify` actually called? I need to track down the callers of this function. Let's start the search... |
| 36/2 | 2026/09/24 07:59 | tool | grepper |
0mArgs:{
"Expression": "ovpn_nl_peer_del_notify",
"PathPrefix": "drivers/net/ovpn"
}Results: {
"Output": "drivers/net/ovpn/netlink.c=1129=int ovpn_nl_key_del_doit(struct sk_buff *skb, struct genl_info *info)\n--\ndrivers/net/ovpn/netlink.c-1172-/**\ndrivers/net/ovpn/netlink.c:1173: * ovpn_nl_peer_del_notify - notify userspace about peer being deleted\ndrivers/net/ovpn/netlink.c-1174- * @peer: the peer being deleted\n--\ndrivers/net/ovpn/netlink.c-1177- */\ndrivers/net/ovpn/netlink.c:1178:int ovpn_nl_peer_del_notify(struct ovpn_peer *peer)\ndrivers/net/ovpn/netlink.c-1179-{\n--\ndrivers/net/ovpn/netlink.h=13=void ovpn_nl_unregister(void);\ndrivers/net/ovpn/netlink.h-14-\ndrivers/net/ovpn/netlink.h:15:int ovpn_nl_peer_del_notify(struct ovpn_peer *peer);\ndrivers/net/ovpn/netlink.h-16-int ovpn_nl_peer_float_notify(struct ovpn_peer *peer,\n--\ndrivers/net/ovpn/peer.c=685=static void ovpn_peer_remove(struct ovpn_peer *peer,\n--\ndrivers/net/ovpn/peer.c-715-\tpeer-\u003edelete_reason = reason;\ndrivers/net/ovpn/peer.c:716:\tovpn_nl_peer_del_notify(peer);\ndrivers/net/ovpn/peer.c-717-\n"
} |
| 37/2 | 2026/09/24 07:59 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 52979 output: 38 thoughts: 26 Thoughts: Okay, let's dive into this. Here's my perspective on examining the `ovpn_peer_remove` function within `drivers/net/ovpn/peer.c`: **Dissecting `ovpn_peer_remove` in `drivers/net/ovpn/peer.c`** Alright, my immediate focus is on `ovpn_peer_remove`. Time to refresh my memory on how this OpenVPN peer removal function is architected and implemented within the kernel's networking stack. I need to understand its control flow, memory management, and potential race conditions. Given the file path, `drivers/net/ovpn/peer.c`, this suggests it's a critical piece for connection teardown, so it's likely involved in releasing resources, signaling to other kernel subsystems, and gracefully handling the endpoint's disconnect. Let's see how they've handled the typical challenges of removing a network peer at the kernel level. |
| 38/2 | 2026/09/24 07:59 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/peer.c",
"FirstLine": 685,
"LineCount": 40
}Results: {
"Contents": " 685:\tstatic void ovpn_peer_remove(struct ovpn_peer *peer,\n 686:\t\t\t\t enum ovpn_del_peer_reason reason,\n 687:\t\t\t\t struct llist_head *release_list)\n 688:\t{\n 689:\t\tlockdep_assert_held(\u0026peer-\u003eovpn-\u003elock);\n 690:\t\n 691:\t\tswitch (peer-\u003eovpn-\u003emode) {\n 692:\t\tcase OVPN_MODE_MP:\n 693:\t\t\t/* prevent double remove */\n 694:\t\t\tif (hlist_unhashed(\u0026peer-\u003ehash_entry_id))\n 695:\t\t\t\treturn;\n 696:\t\n 697:\t\t\thlist_del_init_rcu(\u0026peer-\u003ehash_entry_id);\n 698:\t\t\thlist_nulls_del_init_rcu(\u0026peer-\u003ehash_entry_addr4);\n 699:\t\t\thlist_nulls_del_init_rcu(\u0026peer-\u003ehash_entry_addr6);\n 700:\t\t\thlist_nulls_del_init_rcu(\u0026peer-\u003ehash_entry_transp_addr);\n 701:\t\t\tbreak;\n 702:\t\tcase OVPN_MODE_P2P:\n 703:\t\t\t/* prevent double remove */\n 704:\t\t\tif (peer != rcu_access_pointer(peer-\u003eovpn-\u003epeer))\n 705:\t\t\t\treturn;\n 706:\t\n 707:\t\t\tRCU_INIT_POINTER(peer-\u003eovpn-\u003epeer, NULL);\n 708:\t\t\t/* in P2P mode the carrier is switched off when the peer is\n 709:\t\t\t * deleted so that third party protocols can react accordingly\n 710:\t\t\t */\n 711:\t\t\tnetif_carrier_off(peer-\u003eovpn-\u003edev);\n 712:\t\t\tbreak;\n 713:\t\t}\n 714:\t\n 715:\t\tpeer-\u003edelete_reason = reason;\n 716:\t\tovpn_nl_peer_del_notify(peer);\n 717:\t\n 718:\t\t/* append to provided list for later socket release and ref drop */\n 719:\t\tllist_add(\u0026peer-\u003erelease_entry, release_list);\n 720:\t}\n 721:\t\n 722:\t/**\n 723:\t * ovpn_peer_get_by_dst - Lookup peer to send skb to\n 724:\t * @ovpn: the private data representing the current VPN session\n"
} |
| 39/2 | 2026/09/24 07:59 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 53900 output: 32 thoughts: 490 Thoughts: **Analyzing Peer Deletion Notifications**
Okay, let's break down this peer deletion notification mechanism. Initially, I'm observing the change in the netlink message construction before and after. Previously, we were just sending the delete reason and the peer ID directly. Now, we're using `ovpn_nl_fill_peer` in the newer code. My immediate concern is the `rcu_dereference(peer->sock)` call *within* `ovpn_nl_fill_peer`. This is where it gets interesting... Can the `sock` pointer be null during the call to `ovpn_peer_remove`? The code attempts to handle a null `sock`:
```c
rcu_read_lock();
sock = rcu_dereference(peer->sock);
if (!sock) {
ret = -EINVAL;
goto err_unlock;
}
```
The code checks if `sock` is null and returns an error if it is. But, *should* it be possible to be null?
Let me think this through. `ovpn_peer_remove` calls `llist_add(&peer->release_entry, release_list);`. And the socket is released later during `unlock_ovpn` which calls `ovpn_socket_release(peer);`. So the socket *is* being released asynchronously. My brain is starting to see a race condition. What happens if a peer is created without a socket (initialization failure), or perhaps the socket attachment fails, or in some teardown flow the socket is released first?
I need to confirm these theories. Let's start by searching where `ovpn_peer_remove` or `ovpn_nl_peer_del_notify` are called. This would also be a good time to check `ovpn_peer_new` and other peer creation code to understand the initial socket state.
|
| 40/2 | 2026/09/24 07:59 | tool | grepper |
0mArgs:{
"Expression": "ovpn_peer_remove",
"PathPrefix": "drivers/net/ovpn"
}Results: {
"Output": "drivers/net/ovpn/peer.c=658=struct ovpn_peer *ovpn_peer_get_by_id(struct ovpn_priv *ovpn, u32 peer_id)\n--\ndrivers/net/ovpn/peer.c-684-\ndrivers/net/ovpn/peer.c:685:static void ovpn_peer_remove(struct ovpn_peer *peer,\ndrivers/net/ovpn/peer.c-686-\t\t\t enum ovpn_del_peer_reason reason,\n--\ndrivers/net/ovpn/peer.c=1088=static int ovpn_peer_add_p2p(struct ovpn_priv *ovpn, struct ovpn_peer *peer)\n--\ndrivers/net/ovpn/peer.c-1099-\tif (tmp)\ndrivers/net/ovpn/peer.c:1100:\t\tovpn_peer_remove(tmp, OVPN_DEL_PEER_REASON_TEARDOWN,\ndrivers/net/ovpn/peer.c-1101-\t\t\t\t \u0026release_list);\n--\ndrivers/net/ovpn/peer.c=1155=static int ovpn_peer_del_mp(struct ovpn_peer *peer,\n--\ndrivers/net/ovpn/peer.c-1165-\tif (tmp == peer) {\ndrivers/net/ovpn/peer.c:1166:\t\tovpn_peer_remove(peer, reason, release_list);\ndrivers/net/ovpn/peer.c-1167-\t\tret = 0;\n--\ndrivers/net/ovpn/peer.c=1184=static int ovpn_peer_del_p2p(struct ovpn_peer *peer,\n--\ndrivers/net/ovpn/peer.c-1196-\ndrivers/net/ovpn/peer.c:1197:\tovpn_peer_remove(peer, reason, release_list);\ndrivers/net/ovpn/peer.c-1198-\n--\ndrivers/net/ovpn/peer.c=1236=static void ovpn_peer_release_p2p(struct ovpn_priv *ovpn, struct sock *sk,\n--\ndrivers/net/ovpn/peer.c-1258-\ndrivers/net/ovpn/peer.c:1259:\tovpn_peer_remove(peer, reason, \u0026release_list);\ndrivers/net/ovpn/peer.c-1260-\tunlock_ovpn(ovpn, \u0026release_list);\n--\ndrivers/net/ovpn/peer.c=1263=static void ovpn_peers_release_mp(struct ovpn_priv *ovpn, struct sock *sk,\n--\ndrivers/net/ovpn/peer.c-1286-\t\tif (remove)\ndrivers/net/ovpn/peer.c:1287:\t\t\tovpn_peer_remove(peer, reason, \u0026release_list);\ndrivers/net/ovpn/peer.c-1288-\t}\n--\ndrivers/net/ovpn/peer.c=1312=static time64_t ovpn_peer_keepalive_work_single(struct ovpn_peer *peer,\n--\ndrivers/net/ovpn/peer.c-1346-\t\t\t peer-\u003eid);\ndrivers/net/ovpn/peer.c:1347:\t\tovpn_peer_remove(peer, OVPN_DEL_PEER_REASON_EXPIRED,\ndrivers/net/ovpn/peer.c-1348-\t\t\t\t release_list);\n"
} |
| 41/2 | 2026/09/24 07:59 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 55723 output: 39 thoughts: 54 Thoughts: Here's my summary, as if I were thinking these thoughts: **Analyzing OpenVPN Peer Release Functions** Okay, let's dive into this. I need to refresh my memory on the peer release functions within the OpenVPN kernel driver. Specifically, I'm thinking about the interactions between `ovpn_peer_release_p2p` and `ovpn_peers_release_mp`. I suspect they handle different aspects of peer lifecycle management, probably involving point-to-point and multi-point connections respectively, or perhaps a master and slave relationship between a peer and other peers. Let's focus our attention on `drivers/net/ovpn/peer.c`. I'm going to scan lines 1230 through 1280. That range should provide a good chunk of context around how these functions work together. I'm expecting to see how resources are freed, states are transitioned, and potentially how locks are handled to ensure thread safety during the release process. I want to see if this region of code reveals any potential race conditions. From this line range, I should be able to derive a mental map of their interplay. |
| 42/2 | 2026/09/24 08:00 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/peer.c",
"FirstLine": 1230,
"LineCount": 60
}Results: {
"Contents": "1230:\t/**\n1231:\t * ovpn_peer_release_p2p - release peer upon P2P device teardown\n1232:\t * @ovpn: the instance being torn down\n1233:\t * @sk: if not NULL, release peer only if it's using this specific socket\n1234:\t * @reason: the reason for releasing the peer\n1235:\t */\n1236:\tstatic void ovpn_peer_release_p2p(struct ovpn_priv *ovpn, struct sock *sk,\n1237:\t\t\t\t\t enum ovpn_del_peer_reason reason)\n1238:\t{\n1239:\t\tstruct ovpn_socket *ovpn_sock;\n1240:\t\tLLIST_HEAD(release_list);\n1241:\t\tstruct ovpn_peer *peer;\n1242:\t\n1243:\t\tspin_lock_bh(\u0026ovpn-\u003elock);\n1244:\t\tpeer = rcu_dereference_protected(ovpn-\u003epeer,\n1245:\t\t\t\t\t\t lockdep_is_held(\u0026ovpn-\u003elock));\n1246:\t\tif (!peer) {\n1247:\t\t\tspin_unlock_bh(\u0026ovpn-\u003elock);\n1248:\t\t\treturn;\n1249:\t\t}\n1250:\t\n1251:\t\tif (sk) {\n1252:\t\t\tovpn_sock = rcu_dereference_bh(peer-\u003esock);\n1253:\t\t\tif (!ovpn_sock || ovpn_sock-\u003esk != sk) {\n1254:\t\t\t\tspin_unlock_bh(\u0026ovpn-\u003elock);\n1255:\t\t\t\treturn;\n1256:\t\t\t}\n1257:\t\t}\n1258:\t\n1259:\t\tovpn_peer_remove(peer, reason, \u0026release_list);\n1260:\t\tunlock_ovpn(ovpn, \u0026release_list);\n1261:\t}\n1262:\t\n1263:\tstatic void ovpn_peers_release_mp(struct ovpn_priv *ovpn, struct sock *sk,\n1264:\t\t\t\t\t enum ovpn_del_peer_reason reason)\n1265:\t{\n1266:\t\tstruct ovpn_socket *ovpn_sock;\n1267:\t\tLLIST_HEAD(release_list);\n1268:\t\tstruct ovpn_peer *peer;\n1269:\t\tstruct hlist_node *tmp;\n1270:\t\tint bkt;\n1271:\t\n1272:\t\tspin_lock_bh(\u0026ovpn-\u003elock);\n1273:\t\thash_for_each_safe(ovpn-\u003epeers-\u003eby_id, bkt, tmp, peer, hash_entry_id) {\n1274:\t\t\tbool remove = true;\n1275:\t\n1276:\t\t\t/* if a socket was passed as argument, skip all peers except\n1277:\t\t\t * those using it\n1278:\t\t\t */\n1279:\t\t\tif (sk) {\n1280:\t\t\t\trcu_read_lock();\n1281:\t\t\t\tovpn_sock = rcu_dereference(peer-\u003esock);\n1282:\t\t\t\tremove = ovpn_sock \u0026\u0026 ovpn_sock-\u003esk == sk;\n1283:\t\t\t\trcu_read_unlock();\n1284:\t\t\t}\n1285:\t\n1286:\t\t\tif (remove)\n1287:\t\t\t\tovpn_peer_remove(peer, reason, \u0026release_list);\n1288:\t\t}\n1289:\t\tunlock_ovpn(ovpn, \u0026release_list);\n"
} |
| 43/2 | 2026/09/24 08:00 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 56990 output: 34 thoughts: 632 Thoughts: **Analyzing the Evolution of Peer Removal Notifications** Okay, so I'm looking at the changes in how OpenVPN handles peer removal notifications. Specifically, I'm examining the `ovpn_peer_remove` function and the subsequent `ovpn_nl_peer_del_notify` call. What's catching my eye is the shift in data being transmitted via netlink. Initially, `ovpn_nl_peer_del_notify` was only sending the peer ID (`OVPN_A_PEER_ID`) and the deletion reason (`OVPN_A_PEER_DEL_REASON`) within the `OVPN_CMD_PEER_DEL_NTF` message. Now, the code path shows `ovpn_nl_fill_peer` is called which populates the netlink message. This means *much* more information is being sent out with the notification, including all the juicy peer stats – VPN addresses, keepalive data, bind information, local port, RX/TX bytes, everything! The call stack confirms this: `ovpn_nl_peer_del_notify` constructs the netlink message, then calls `ovpn_nl_fill_peer`. If `ovpn_nl_fill_peer` encounters a problem (like a missing socket, evidenced by the `-EINVAL` return), the message is canceled and the error is returned. However, if no error, the whole peer structure is now being multicast over the netlink family `OVPN_NLGRP_PEERS`. Given this is a significant change, I really need to understand the *why*. The change to send all the peer data with the notification is substantial, so I need to check the commit log or description to figure out the use case. I need to understand the reasoning behind this added overhead, and determine if it's justified. |
| 44/2 | 2026/09/24 08:01 | tool | grepper |
0mArgs:{
"Expression": "ovpn_nl_fill_peer",
"PathPrefix": "drivers/net/ovpn"
}Results: {
"Output": "drivers/net/ovpn/netlink.c=475=int ovpn_nl_peer_set_doit(struct sk_buff *skb, struct genl_info *info)\n--\ndrivers/net/ovpn/netlink.c-548-\ndrivers/net/ovpn/netlink.c:549:static int ovpn_nl_fill_peer(struct sk_buff *skb, const struct genl_info *info,\ndrivers/net/ovpn/netlink.c-550-\t\t\t const struct ovpn_peer *peer)\n--\ndrivers/net/ovpn/netlink.c=651=static int ovpn_nl_send_peer(struct sk_buff *skb, const struct genl_info *info,\n--\ndrivers/net/ovpn/netlink.c-667-\ndrivers/net/ovpn/netlink.c:668:\tret = ovpn_nl_fill_peer(skb, info, peer);\ndrivers/net/ovpn/netlink.c-669-\tif (ret \u003c 0)\n--\ndrivers/net/ovpn/netlink.c=1178=int ovpn_nl_peer_del_notify(struct ovpn_peer *peer)\n--\ndrivers/net/ovpn/netlink.c-1208-\ndrivers/net/ovpn/netlink.c:1209:\tret = ovpn_nl_fill_peer(msg, NULL, peer);\ndrivers/net/ovpn/netlink.c-1210-\tif (ret \u003c 0)\n"
} |
| 45/2 | 2026/09/24 08:01 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 58443 output: 34 thoughts: 1077 Thoughts: **Fuzzing Decision for the OpenVPN Data Channel Offload Patch Series** Okay, so the task is to determine if this patch series is worth fuzzing. I don't have direct access to `git log`, but I know the commit diff, so let's work with that and the instructions. The primary question is: "Is this patch series worth fuzzing?" First, I need to review the guidelines to refresh my memory. Let's start with the rules: the core triage philosophy states that the goal of patch fuzzing is to discover issues. Reachability is the crucial factor. If the code is unreachable, it's a no-go. I can't blindly trust claims of "no functional change" because refactoring or other changes could introduce subtle issues. Assertions in reachable code *must* be fuzzed. Now I need to evaluate the changes against the negative and positive criteria. I can return `WorthFuzzing=false` only if the changes are strictly non-kernel/non-executable, structurally unreachable hardware, or unreachable execution paths. On the flip side, I'll return `WorthFuzzing=true` if the patch touches any reachable executable code. That includes core subsystems, refactorings of reachable data structures, new or altered assertions in reachable paths, and reachable drivers and protocols. Let's dive into the patch details. The OpenVPN data channel offload (`drivers/net/ovpn/`) is definitely a virtual network device. Virtual network devices are accessible via generic netlink and sockets. The patch modifies reachable executable code: I see changes to `ovpn_decrypt_post`, `ovpn_encrypt_post`, `ovpn_nl_fill_peer`, and `ovpn_nl_peer_del_notify`, as well as a change to `drivers/net/ovpn/socket.h`. This means it *is* reachable in QEMU in a standard environment via rtnl (`ip link add dev ... type ovpn`) or netlink (`genl`). Therefore, it clearly touches reachable executable code. Given all this, I'm confident that `WorthFuzzing` should be `true`! The patch involves modifications to potentially critical sections and is reachable. Now, let's nail down some important details. I need to figure out the required kernel configurations: First, I'll check `EnableConfigs`. Then, I'll check `FocusSymbols`. I need to know the configurations needed for the OpenVPN code in `drivers/net/Kconfig` around line 103: ```kconfig config OVPN tristate "OpenVPN data channel offload" depends on NET && INET select DST_CACHE select NET_UDP_TUNNEL select CRYPTO select CRYPTO_AES select CRYPTO_GCM select CRYPTO_CHACHA20POLY1305 select STREAM_PARSER ``` I'll also have to ensure there aren't any other configurations in `drivers/net/ovpn`, so I'll need to check the `drivers/net/ovpn/Makefile` to confirm the dependencies. |
| 46/2 | 2026/09/24 08:01 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/Makefile",
"FirstLine": 1,
"LineCount": 30
}Results: {
"Contents": " 1:\t# SPDX-License-Identifier: GPL-2.0\n 2:\t#\n 3:\t# ovpn -- OpenVPN data channel offload in kernel space\n 4:\t#\n 5:\t# Copyright (C) 2020-2025 OpenVPN, Inc.\n 6:\t#\n 7:\t# Author:\tAntonio Quartulli \u003cantonio@openvpn.net\u003e\n 8:\t\n 9:\tobj-$(CONFIG_OVPN) := ovpn.o\n 10:\tovpn-y += bind.o\n 11:\tovpn-y += crypto.o\n 12:\tovpn-y += crypto_aead.o\n 13:\tovpn-y += main.o\n 14:\tovpn-y += io.o\n 15:\tovpn-y += netlink.o\n 16:\tovpn-y += netlink-gen.o\n 17:\tovpn-y += peer.o\n 18:\tovpn-y += pktid.o\n 19:\tovpn-y += socket.o\n 20:\tovpn-y += stats.o\n 21:\tovpn-y += tcp.o\n 22:\tovpn-y += udp.o\n"
} |
| 47/2 | 2026/09/24 08:01 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 60559 output: 34 thoughts: 621 Thoughts: **Analyzing the OpenVPN Configuration and Identifying Relevant Symbols** Okay, so I'm diving into this OpenVPN module. My initial thought is to figure out the minimal configuration needed to build and, critically, trigger the code modifications. Let's see... `obj-$(CONFIG_OVPN) := ovpn.o` confirms that `CONFIG_OVPN` is the key. The source files are all under the `drivers/net/ovpn` directory, and are compiled into `ovpn.o` when `CONFIG_OVPN` is enabled. It is clear that this option guards all the relevant code. Now, let's look at the dependencies. `CONFIG_OVPN` depends on `NET` and `INET`. `NET` and `INET` are usually enabled in syzkaller configurations, but let's be thorough. I need to make sure there aren't any hidden dependencies. A quick check of `net/ipv4/Kconfig` confirms `INET` maps to `CONFIG_INET`. So, effectively, we need to ensure `CONFIG_OVPN` and `CONFIG_INET` (although the dependency is implied by `OVPN`) are enabled. So, the instructions are clear: identify the specific CONFIG options – `OVPN` – and related options, ignoring assumptions. Now, for the interesting part – identifying which functions are *actually* affected. Let's inspect the diff, and the goal is to pinpoint the specific functions which require this config to trigger. I see in `drivers/net/ovpn/io.c`: `ovpn_decrypt_post` and `ovpn_encrypt_post` are the non-static functions of interest. Over in `drivers/net/ovpn/netlink.c`, I have `ovpn_nl_send_peer` (a static function), `ovpn_nl_fill_peer` (also static), and `ovpn_nl_peer_del_notify` (a non-static function). Hang on... `ovpn_nl_send_peer` is static... that means it's not directly exposed as an entry point. We should check the callers of this function. Let me see what calls `ovpn_nl_send_peer`, because that's the real entry point! |
| 48/2 | 2026/09/24 08:01 | tool | grepper |
0mArgs:{
"Expression": "ovpn_nl_send_peer",
"PathPrefix": "drivers/net/ovpn"
}Results: {
"Output": "drivers/net/ovpn/netlink.c=549=static int ovpn_nl_fill_peer(struct sk_buff *skb, const struct genl_info *info,\n--\ndrivers/net/ovpn/netlink.c-650-\ndrivers/net/ovpn/netlink.c:651:static int ovpn_nl_send_peer(struct sk_buff *skb, const struct genl_info *info,\ndrivers/net/ovpn/netlink.c-652-\t\t\t const struct ovpn_peer *peer, u32 portid, u32 seq,\n--\ndrivers/net/ovpn/netlink.c=681=int ovpn_nl_peer_get_doit(struct sk_buff *skb, struct genl_info *info)\n--\ndrivers/net/ovpn/netlink.c-732-\ndrivers/net/ovpn/netlink.c:733:\tret = ovpn_nl_send_peer(msg, info, peer, info-\u003esnd_portid,\ndrivers/net/ovpn/netlink.c-734-\t\t\t\tinfo-\u003esnd_seq, 0);\n--\ndrivers/net/ovpn/netlink.c=746=int ovpn_nl_peer_get_dumpit(struct sk_buff *skb, struct netlink_callback *cb)\n--\ndrivers/net/ovpn/netlink.c-765-\t\tif (peer) {\ndrivers/net/ovpn/netlink.c:766:\t\t\tif (ovpn_nl_send_peer(skb, info, peer,\ndrivers/net/ovpn/netlink.c-767-\t\t\t\t\t NETLINK_CB(cb-\u003eskb).portid,\n--\ndrivers/net/ovpn/netlink.c-784-\ndrivers/net/ovpn/netlink.c:785:\t\t\tif (ovpn_nl_send_peer(skb, info, peer,\ndrivers/net/ovpn/netlink.c-786-\t\t\t\t\t NETLINK_CB(cb-\u003eskb).portid,\n"
} |
| 49/2 | 2026/09/24 08:01 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 62224 output: 200 thoughts: 1484 Thoughts: **Focus Symbol Identification for OpenVPN Data Channel Offload** Okay, let's break this down for the fuzzing setup. I see that `ovpn_nl_peer_get_doit` and `ovpn_nl_peer_get_dumpit` are calling `ovpn_nl_send_peer`, and `ovpn_nl_peer_del_notify` calls `ovpn_nl_fill_peer`. And `ovpn_nl_peer_del_notify` is called during peer deletion via `ovpn_peer_remove`. My immediate thought is to check if those functions can be inlined or if they are separate, because the fuzzer can't target inline functions. `ovpn_nl_send_peer` is static in `netlink.c`, which makes it a potential target; it *might* get inlined depending on compiler optimizations, but syzkaller usually keeps symbols for static functions. `ovpn_nl_peer_del_notify` is non-static (declared in `netlink.h`), which is good. Similarly, `ovpn_decrypt_post` and `ovpn_encrypt_post` are non-static and in `io.h`, called from `crypto_aead.c` as crypto callbacks. Now, considering the FocusSymbols criteria: we need to avoid ubiquitous lifecycle functions and target specific logic or entry points. Specifically, it states that static inline functions can't be targeted, so we need the caller functions. So, let's identify the modified/target functions based on the patch: * `ovpn_nl_peer_del_notify`: This has been modified to call `ovpn_nl_fill_peer`. * `ovpn_nl_fill_peer`: This is a new helper that has been extracted/modified to populate peer info. * `ovpn_nl_send_peer`: This has been modified to now also call `ovpn_nl_fill_peer`. * `ovpn_decrypt_post`: Modified to unconditionally call `ovpn_peer_put(peer)`. * `ovpn_encrypt_post`: Modified to unconditionally call `ovpn_peer_put(peer)`. And the entrypoints that exercise these are: * `ovpn_nl_peer_get_doit`: This is a direct entrypoint for `ovpn_nl_send_peer`. * `ovpn_nl_peer_del_doit`: This is a direct entrypoint that triggers the `ovpn_peer_del` path. I need to confirm if these are all available. Wait a second. I remember syzkaller. Since these are in `drivers/net/ovpn/netlink.c`, the static functions *should* retain their symbols in coverage builds. We can still focus on both the altered functions (that's `ovpn_nl_fill_peer`, `ovpn_nl_send_peer`, `ovpn_nl_peer_del_notify`, `ovpn_decrypt_post`, `ovpn_encrypt_post`) *and* the relevant entry points (that's `ovpn_nl_peer_get_doit`, `ovpn_nl_peer_del_doit`). Hold on, let me check about `ovpn_peer_put`. Yes, it's a static inline, so that is out! `ovpn_bind_from_sockaddr` is unchanged. `ovpn_nl_fill_peer`, `ovpn_nl_peer_del_notify`, `ovpn_decrypt_post`, and `ovpn_encrypt_post` are all good. Okay, let's do a final sanity check of the changes: 1. `bind.c`: Only a kernel-doc comment updated. 2. `io.c`: Changed `ovpn_decrypt_post` and `ovpn_encrypt_post` by adding `ovpn_peer_put(peer)`. 3. `netlink.c`: Refactored `ovpn_nl_send_peer` by extracting `ovpn_nl_fill_peer` and added a NULL check for `info` in `ovpn_nl_fill_peer`. Made `ovpn_nl_peer_del_notify` call `ovpn_nl_fill_peer`. 4. `socket.h`: Removed a struct member. 5. `selftests`: Nothing of concern. Everything is clear. The patch clearly touches reachable OpenVPN networking driver code and is reachable through netlink and socket operations. Config needed is `OVPN`. Based on this review, my FocusSymbols list should be: * `ovpn_ |
| 50/2 | 2026/09/24 08:01 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"OVPN"
],
"FocusSymbols": [
"ovpn_nl_peer_del_notify",
"ovpn_nl_fill_peer",
"ovpn_nl_send_peer",
"ovpn_decrypt_post",
"ovpn_encrypt_post"
],
"Reasoning": "The patch modifies executable code in the OpenVPN data channel offload (ovpn) driver. Specifically, it updates ovpn_decrypt_post and ovpn_encrypt_post to drop peer references unconditionally, refactors netlink peer serialization by introducing ovpn_nl_fill_peer to handle both peer get queries and peer deletion notifications (passing a NULL genl_info), and removes an unused work_struct field from struct ovpn_socket. These changes modify reachable network device logic and generic netlink notification handling, making them relevant for fuzzing.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"OVPN"
],
"FocusSymbols": [
"ovpn_nl_peer_del_notify",
"ovpn_nl_fill_peer",
"ovpn_nl_send_peer",
"ovpn_decrypt_post",
"ovpn_encrypt_post"
],
"Reasoning": "The patch modifies executable code in the OpenVPN data channel offload (ovpn) driver. Specifically, it updates ovpn_decrypt_post and ovpn_encrypt_post to drop peer references unconditionally, refactors netlink peer serialization by introducing ovpn_nl_fill_peer to handle both peer get queries and peer deletion notifications (passing a NULL genl_info), and removes an unused work_struct field from struct ovpn_socket. These changes modify reachable network device logic and generic netlink notification handling, making them relevant for fuzzing.",
"WorthFuzzing": true
} |
| 51/1 | 2026/09/24 08:01 | action | If |
1mArgs:{
"WorthFuzzing": true
}Results: null |
| 52/2 | 2026/09/24 08:01 | agent | kmsan-evaluator |
1mModel:core Args: null Results: {
"KMSANReasoning": "The patch series refactors netlink peer attribute formatting by extracting ovpn_nl_fill_peer() from ovpn_nl_send_peer() and reusing it in ovpn_nl_peer_del_notify(). In addition, it removes redundant peer null-checks in ovpn_decrypt_post() and ovpn_encrypt_post(), removes an unused work_struct field from struct ovpn_socket, updates documentation in bind.c, and updates selftests.\n\nAll peer and socket data structures in ovpn are allocated via kzalloc_obj, ensuring all fields are zero-initialized upon creation. The netlink attributes added to peer deletion notifications use standard typed nla_put helpers (e.g., nla_put_u32, nla_put_in_addr, nla_put_in6_addr, nla_put_uint) without copying uninitialized memory or struct padding to userspace. No uninitialized stack or heap data is introduced, modified, or branched upon. Any potential bugs introduced by these changes (such as reference counting issues with ovpn_peer_put, NULL pointer dereferences, or netlink skb allocation failures) are covered by standard kernel debuggers, KASAN, and LOCKDEP. Therefore, dedicated KMSAN fuzzing is not warranted.",
"NeedsKMSAN": false
}Instruction: You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.
CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
a comprehensive suite of debugging tools and sanitizers, including KASAN
(out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
(locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
or page allocations) and kernel-to-user memory info-leaks.
Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.
Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.
Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
attributes, ioctl output arguments, socket options, or BPF buffers) where fields
or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
uninitialized bytes of existing buffers.
Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
dereferences, locking deadlocks, or use-after-free bugs (these are already caught
by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.
Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit 5bf582250437d57dbc82cb83a2732ff5df13635c
Author: syz-cluster <triage@syzkaller.com>
Date: Thu Sep 24 07:58:20 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/net/ovpn/bind.c b/drivers/net/ovpn/bind.c
index e42b60cd04a98..62a5ccfd3502a 100644
--- a/drivers/net/ovpn/bind.c
+++ b/drivers/net/ovpn/bind.c
@@ -18,7 +18,7 @@
* ovpn_bind_from_sockaddr - retrieve binding matching sockaddr
* @ss: the sockaddr to match
*
- * Return: the bind matching the passed sockaddr if found, NULL otherwise
+ * Return: the new bind for the passed sockaddr, an ERR_PTR() on failure
*/
struct ovpn_bind *ovpn_bind_from_sockaddr(const struct sockaddr_storage *ss)
{
diff --git a/drivers/net/ovpn/io.c b/drivers/net/ovpn/io.c
index 9526f8096da60..f14eb4e6c46ad 100644
--- a/drivers/net/ovpn/io.c
+++ b/drivers/net/ovpn/io.c
@@ -206,8 +206,7 @@ void ovpn_decrypt_post(void *data, int ret)
drop_nocount:
if (likely(ks))
ovpn_crypto_key_slot_put(ks);
- if (likely(peer))
- ovpn_peer_put(peer);
+ ovpn_peer_put(peer);
}
/* RX path entry point: decrypt packet and forward it to the device */
@@ -305,8 +304,7 @@ void ovpn_encrypt_post(void *data, int ret)
kfree_skb(skb);
if (likely(ks))
ovpn_crypto_key_slot_put(ks);
- if (likely(peer))
- ovpn_peer_put(peer);
+ ovpn_peer_put(peer);
}
static bool ovpn_encrypt_one(struct ovpn_peer *peer, struct sk_buff *skb)
diff --git a/drivers/net/ovpn/netlink.c b/drivers/net/ovpn/netlink.c
index 4dad852941982..aaca0612d6f4c 100644
--- a/drivers/net/ovpn/netlink.c
+++ b/drivers/net/ovpn/netlink.c
@@ -546,27 +546,15 @@ int ovpn_nl_peer_set_doit(struct sk_buff *skb, struct genl_info *info)
return 0;
}
-static int ovpn_nl_send_peer(struct sk_buff *skb, const struct genl_info *info,
- const struct ovpn_peer *peer, u32 portid, u32 seq,
- int flags)
+static int ovpn_nl_fill_peer(struct sk_buff *skb, const struct genl_info *info,
+ const struct ovpn_peer *peer)
{
const struct ovpn_bind *bind;
struct ovpn_socket *sock;
int ret = -EMSGSIZE;
- struct nlattr *attr;
__be16 local_port;
- void *hdr;
int id;
- hdr = genlmsg_put(skb, portid, seq, &ovpn_nl_family, flags,
- OVPN_CMD_PEER_GET);
- if (!hdr)
- return -ENOBUFS;
-
- attr = nla_nest_start(skb, OVPN_A_PEER);
- if (!attr)
- goto err;
-
rcu_read_lock();
sock = rcu_dereference(peer->sock);
if (!sock) {
@@ -574,7 +562,7 @@ static int ovpn_nl_send_peer(struct sk_buff *skb, const struct genl_info *info,
goto err_unlock;
}
- if (!net_eq(genl_info_net(info), sock_net(sock->sk))) {
+ if (info && !net_eq(genl_info_net(info), sock_net(sock->sk))) {
id = peernet2id_alloc(genl_info_net(info),
sock_net(sock->sk),
GFP_ATOMIC);
@@ -585,26 +573,26 @@ static int ovpn_nl_send_peer(struct sk_buff *skb, const struct genl_info *info,
rcu_read_unlock();
if (nla_put_u32(skb, OVPN_A_PEER_ID, peer->id))
- goto err;
+ return -EMSGSIZE;
if (nla_put_u32(skb, OVPN_A_PEER_TX_ID, peer->tx_id))
- goto err;
+ return -EMSGSIZE;
if (peer->vpn_addrs.ipv4.s_addr != htonl(INADDR_ANY))
if (nla_put_in_addr(skb, OVPN_A_PEER_VPN_IPV4,
peer->vpn_addrs.ipv4.s_addr))
- goto err;
+ return -EMSGSIZE;
if (!ipv6_addr_equal(&peer->vpn_addrs.ipv6, &in6addr_any))
if (nla_put_in6_addr(skb, OVPN_A_PEER_VPN_IPV6,
&peer->vpn_addrs.ipv6))
- goto err;
+ return -EMSGSIZE;
if (nla_put_u32(skb, OVPN_A_PEER_KEEPALIVE_INTERVAL,
peer->keepalive_interval) ||
nla_put_u32(skb, OVPN_A_PEER_KEEPALIVE_TIMEOUT,
peer->keepalive_timeout))
- goto err;
+ return -EMSGSIZE;
rcu_read_lock();
bind = rcu_dereference(peer->bind);
@@ -652,14 +640,39 @@ static int ovpn_nl_send_peer(struct sk_buff *skb, const struct genl_info *info,
atomic64_read(&peer->link_stats.tx.bytes)) ||
nla_put_uint(skb, OVPN_A_PEER_LINK_TX_PACKETS,
atomic64_read(&peer->link_stats.tx.packets)))
+ return -EMSGSIZE;
+
+ return 0;
+err_unlock:
+ rcu_read_unlock();
+ return ret;
+}
+
+static int ovpn_nl_send_peer(struct sk_buff *skb, const struct genl_info *info,
+ const struct ovpn_peer *peer, u32 portid, u32 seq,
+ int flags)
+{
+ struct nlattr *attr;
+ int ret = -EMSGSIZE;
+ void *hdr;
+
+ hdr = genlmsg_put(skb, portid, seq, &ovpn_nl_family, flags,
+ OVPN_CMD_PEER_GET);
+ if (!hdr)
+ return -ENOBUFS;
+
+ attr = nla_nest_start(skb, OVPN_A_PEER);
+ if (!attr)
+ goto err;
+
+ ret = ovpn_nl_fill_peer(skb, info, peer);
+ if (ret < 0)
goto err;
nla_nest_end(skb, attr);
genlmsg_end(skb, hdr);
return 0;
-err_unlock:
- rcu_read_unlock();
err:
genlmsg_cancel(skb, hdr);
return ret;
@@ -1193,7 +1206,8 @@ int ovpn_nl_peer_del_notify(struct ovpn_peer *peer)
if (nla_put_u32(msg, OVPN_A_PEER_DEL_REASON, peer->delete_reason))
goto err_cancel_msg;
- if (nla_put_u32(msg, OVPN_A_PEER_ID, peer->id))
+ ret = ovpn_nl_fill_peer(msg, NULL, peer);
+ if (ret < 0)
goto err_cancel_msg;
nla_nest_end(msg, attr);
diff --git a/drivers/net/ovpn/socket.h b/drivers/net/ovpn/socket.h
index 4afcec71040d9..5c87392ecd304 100644
--- a/drivers/net/ovpn/socket.h
+++ b/drivers/net/ovpn/socket.h
@@ -24,7 +24,6 @@ struct ovpn_peer;
* @peer: unique peer transmitting over this socket (TCP only)
* @sk: the low level sock object
* @refcount: amount of contexts currently referencing this object
- * @work: member used to schedule release routine (it may block)
* @tcp_tx_work: work for deferring outgoing packet processing (TCP only)
*/
struct ovpn_socket {
@@ -38,7 +37,6 @@ struct ovpn_socket {
struct sock *sk;
struct kref refcount;
- struct work_struct work;
struct work_struct tcp_tx_work;
};
diff --git a/tools/testing/selftests/net/ovpn/common.sh b/tools/testing/selftests/net/ovpn/common.sh
index 2d844eb3aa6e3..611d528c7de88 100644
--- a/tools/testing/selftests/net/ovpn/common.sh
+++ b/tools/testing/selftests/net/ovpn/common.sh
@@ -19,9 +19,42 @@ OVPN_VERBOSE=${OVPN_VERBOSE:-0}
export OVPN_ID_OFFSET=$(( 9 * (OVPN_SYMMETRIC_ID == 0) ))
-OVPN_JQ_FILTER='map(if type == "array" then .[] else . end) |
- map(select(.msg.peer | has("remote-ipv6") | not)) |
- map(del(.msg.ifindex)) | sort_by(.msg.peer.id)[]'
+# Peer delete notifications include traffic counters whose values depend on
+# timing. zero_attr() sets a counter to zero only when that counter is present,
+# so missing stats still fail the comparison. zero_peer_stats is just the list
+# of counters to normalize. normalize_peer_del_ntf applies that to peer-del-ntf
+# messages and drops transport endpoint details, while leaving other
+# notifications unchanged.
+OVPN_JQ_FILTER='
+ def zero_attr(key):
+ if has(key) then .[key] = 0 else . end;
+
+ def zero_peer_stats:
+ zero_attr("vpn-rx-bytes") |
+ zero_attr("vpn-rx-packets") |
+ zero_attr("vpn-tx-bytes") |
+ zero_attr("vpn-tx-packets") |
+ zero_attr("link-rx-bytes") |
+ zero_attr("link-rx-packets") |
+ zero_attr("link-tx-bytes") |
+ zero_attr("link-tx-packets");
+
+ def normalize_peer_del_ntf:
+ if .name == "peer-del-ntf" then
+ .msg.peer |= (
+ del(.["remote-ipv4"], .["remote-ipv6"],
+ .["remote-ipv6-scope-id"], .["remote-port"],
+ .["local-ipv4"], .["local-ipv6"],
+ .["local-port"]) |
+ zero_peer_stats
+ )
+ else . end;
+
+ map(if type == "array" then .[] else . end) |
+ map(del(.msg.ifindex)) |
+ map(normalize_peer_del_ntf) |
+ sort_by(.msg.peer.id)[]'
+
OVPN_LAN_IP="11.11.11.11"
declare -A OVPN_TMP_JSONS=()
@@ -178,20 +211,14 @@ ovpn_setup_ns() {
ovpn_build_capture_filter() {
# match the first four bytes of the openvpn data payload
- if [ "${OVPN_PROTO}" == "UDP" ]; then
- # For UDP, libpcap transport indexing only works for IPv4, so
- # use an explicit IPv4 or IPv6 expression based on the peer
- # address. The IPv6 branch assumes there are no extension
- # headers in the outer packet.
- if [[ "${2}" == *:* ]]; then
- printf "ip6 and ip6[6] = 17 and ip6[48:4] = %s" "${1}"
- else
- printf "ip and udp[8:4] = %s" "${1}"
- fi
+ # For UDP, libpcap transport indexing only works for IPv4, so
+ # use an explicit IPv4 or IPv6 expression based on the peer
+ # address. The IPv6 branch assumes there are no extension
+ # headers in the outer packet.
+ if [[ "${2}" == *:* ]]; then
+ printf "ip6 and ip6[6] = 17 and ip6[48:4] = %s" "${1}"
else
- # openvpn over TCP prepends a 2-byte packet length ahead of the
- # DATA_V2 opcode, so skip it before matching the payload header
- printf "ip and tcp[(((tcp[12] & 0xf0) >> 2) + 2):4] = %s" "${1}"
+ printf "ip and udp[8:4] = %s" "${1}"
fi
}
diff --git a/tools/testing/selftests/net/ovpn/json/peer0-float.json b/tools/testing/selftests/net/ovpn/json/peer0-float.json
index 682fa58ad4ea8..9711f2cf9cf60 100644
--- a/tools/testing/selftests/net/ovpn/json/peer0-float.json
+++ b/tools/testing/selftests/net/ovpn/json/peer0-float.json
@@ -1,9 +1,9 @@
{"name": "peer-float-ntf", "msg": {"ifindex": 0, "peer": {"id": 1, "remote-ipv4": "10.10.1.3", "remote-port": 1}}}
{"name": "peer-float-ntf", "msg": {"ifindex": 0, "peer": {"id": 2, "remote-ipv4": "10.10.2.3", "remote-port": 1}}}
{"name": "peer-float-ntf", "msg": {"ifindex": 0, "peer": {"id": 3, "remote-ipv4": "10.10.3.3", "remote-port": 1}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 1}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 2}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 3}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 4}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 5}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 6}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 1, "tx-id": 10, "vpn-ipv4": "5.5.5.2", "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 2, "tx-id": 11, "vpn-ipv4": "5.5.5.3", "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 3, "tx-id": 12, "vpn-ipv4": "5.5.5.4", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 4, "tx-id": 13, "vpn-ipv4": "5.5.5.5", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 5, "tx-id": 14, "vpn-ipv4": "5.5.5.6", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 6, "tx-id": 15, "vpn-ipv4": "5.5.5.7", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer0-symm-float.json b/tools/testing/selftests/net/ovpn/json/peer0-symm-float.json
deleted file mode 120000
index e31a5bd598638..0000000000000
--- a/tools/testing/selftests/net/ovpn/json/peer0-symm-float.json
+++ /dev/null
@@ -1 +0,0 @@
-peer0-float.json
\ No newline at end of file
diff --git a/tools/testing/selftests/net/ovpn/json/peer0-symm-float.json b/tools/testing/selftests/net/ovpn/json/peer0-symm-float.json
new file mode 100644
index 0000000000000..c94dcc81c80e8
--- /dev/null
+++ b/tools/testing/selftests/net/ovpn/json/peer0-symm-float.json
@@ -0,0 +1,9 @@
+{"name": "peer-float-ntf", "msg": {"ifindex": 0, "peer": {"id": 1, "remote-ipv4": "10.10.1.3", "remote-port": 1}}}
+{"name": "peer-float-ntf", "msg": {"ifindex": 0, "peer": {"id": 2, "remote-ipv4": "10.10.2.3", "remote-port": 1}}}
+{"name": "peer-float-ntf", "msg": {"ifindex": 0, "peer": {"id": 3, "remote-ipv4": "10.10.3.3", "remote-port": 1}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 1, "tx-id": 1, "vpn-ipv4": "5.5.5.2", "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 2, "tx-id": 2, "vpn-ipv4": "5.5.5.3", "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 3, "tx-id": 3, "vpn-ipv4": "5.5.5.4", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 4, "tx-id": 4, "vpn-ipv4": "5.5.5.5", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 5, "tx-id": 5, "vpn-ipv4": "5.5.5.6", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 6, "tx-id": 6, "vpn-ipv4": "5.5.5.7", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer0-symm.json b/tools/testing/selftests/net/ovpn/json/peer0-symm.json
deleted file mode 120000
index 57a163048eeda..0000000000000
--- a/tools/testing/selftests/net/ovpn/json/peer0-symm.json
+++ /dev/null
@@ -1 +0,0 @@
-peer0.json
\ No newline at end of file
diff --git a/tools/testing/selftests/net/ovpn/json/peer0-symm.json b/tools/testing/selftests/net/ovpn/json/peer0-symm.json
new file mode 100644
index 0000000000000..2899913ea0643
--- /dev/null
+++ b/tools/testing/selftests/net/ovpn/json/peer0-symm.json
@@ -0,0 +1,6 @@
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 1, "tx-id": 1, "vpn-ipv4": "5.5.5.2", "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 2, "tx-id": 2, "vpn-ipv4": "5.5.5.3", "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 3, "tx-id": 3, "vpn-ipv4": "5.5.5.4", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 4, "tx-id": 4, "vpn-ipv4": "5.5.5.5", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 5, "tx-id": 5, "vpn-ipv4": "5.5.5.6", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 6, "tx-id": 6, "vpn-ipv4": "5.5.5.7", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer0.json b/tools/testing/selftests/net/ovpn/json/peer0.json
index 7c46a33d5ecdf..fff2a86b41ab8 100644
--- a/tools/testing/selftests/net/ovpn/json/peer0.json
+++ b/tools/testing/selftests/net/ovpn/json/peer0.json
@@ -1,6 +1,6 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 1}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 2}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 3}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 4}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 5}}}
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 6}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 1, "tx-id": 10, "vpn-ipv4": "5.5.5.2", "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 2, "tx-id": 11, "vpn-ipv4": "5.5.5.3", "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 3, "tx-id": 12, "vpn-ipv4": "5.5.5.4", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 4, "tx-id": 13, "vpn-ipv4": "5.5.5.5", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 5, "tx-id": 14, "vpn-ipv4": "5.5.5.6", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 6, "tx-id": 15, "vpn-ipv4": "5.5.5.7", "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer1-symm.json b/tools/testing/selftests/net/ovpn/json/peer1-symm.json
index 5da4ea9d51fb3..41b358e1be51c 100644
--- a/tools/testing/selftests/net/ovpn/json/peer1-symm.json
+++ b/tools/testing/selftests/net/ovpn/json/peer1-symm.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 1}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 1, "tx-id": 1, "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer1.json b/tools/testing/selftests/net/ovpn/json/peer1.json
index 1009d26dc14a2..6332709d2a88e 100644
--- a/tools/testing/selftests/net/ovpn/json/peer1.json
+++ b/tools/testing/selftests/net/ovpn/json/peer1.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 10}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 10, "tx-id": 1, "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer2-symm.json b/tools/testing/selftests/net/ovpn/json/peer2-symm.json
index 8f6db4f8c2ac4..b1840bf979e8f 100644
--- a/tools/testing/selftests/net/ovpn/json/peer2-symm.json
+++ b/tools/testing/selftests/net/ovpn/json/peer2-symm.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 2}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 2, "tx-id": 2, "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer2.json b/tools/testing/selftests/net/ovpn/json/peer2.json
index 44e9fad2b6221..431427e4eb53b 100644
--- a/tools/testing/selftests/net/ovpn/json/peer2.json
+++ b/tools/testing/selftests/net/ovpn/json/peer2.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 11}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "userspace", "id": 11, "tx-id": 2, "keepalive-interval": 60, "keepalive-timeout": 120, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer3-symm.json b/tools/testing/selftests/net/ovpn/json/peer3-symm.json
index bdabd6fa2e647..f9ab2a15dd9fd 100644
--- a/tools/testing/selftests/net/ovpn/json/peer3-symm.json
+++ b/tools/testing/selftests/net/ovpn/json/peer3-symm.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 3}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 3, "tx-id": 3, "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer3.json b/tools/testing/selftests/net/ovpn/json/peer3.json
index d4be8ba130ae3..4f9522a664ee4 100644
--- a/tools/testing/selftests/net/ovpn/json/peer3.json
+++ b/tools/testing/selftests/net/ovpn/json/peer3.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 12}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 12, "tx-id": 3, "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer4-symm.json b/tools/testing/selftests/net/ovpn/json/peer4-symm.json
index c3734bb9251b0..b41ab838a304f 100644
--- a/tools/testing/selftests/net/ovpn/json/peer4-symm.json
+++ b/tools/testing/selftests/net/ovpn/json/peer4-symm.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 4}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 4, "tx-id": 4, "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer4.json b/tools/testing/selftests/net/ovpn/json/peer4.json
index 67d27e2d48ac9..7d6b3c8af0e46 100644
--- a/tools/testing/selftests/net/ovpn/json/peer4.json
+++ b/tools/testing/selftests/net/ovpn/json/peer4.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 13}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 13, "tx-id": 4, "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer5-symm.json b/tools/testing/selftests/net/ovpn/json/peer5-symm.json
index 46c4a348299d6..962def1ec16f3 100644
--- a/tools/testing/selftests/net/ovpn/json/peer5-symm.json
+++ b/tools/testing/selftests/net/ovpn/json/peer5-symm.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 5}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 5, "tx-id": 5, "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer5.json b/tools/testing/selftests/net/ovpn/json/peer5.json
index ecd9bd0b2f371..963dc74cdaa60 100644
--- a/tools/testing/selftests/net/ovpn/json/peer5.json
+++ b/tools/testing/selftests/net/ovpn/json/peer5.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 14}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 14, "tx-id": 5, "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer6-symm.json b/tools/testing/selftests/net/ovpn/json/peer6-symm.json
index aa30f2cff625b..3ff352fae60fb 100644
--- a/tools/testing/selftests/net/ovpn/json/peer6-symm.json
+++ b/tools/testing/selftests/net/ovpn/json/peer6-symm.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 6}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 6, "tx-id": 6, "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/json/peer6.json b/tools/testing/selftests/net/ovpn/json/peer6.json
index 7fded29c58043..0db187f3af189 100644
--- a/tools/testing/selftests/net/ovpn/json/peer6.json
+++ b/tools/testing/selftests/net/ovpn/json/peer6.json
@@ -1 +1 @@
-{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 15}}}
+{"name": "peer-del-ntf", "msg": {"ifindex": 0, "peer": {"del-reason": "expired", "id": 15, "tx-id": 6, "keepalive-interval": 3, "keepalive-timeout": 3, "vpn-rx-bytes": 0, "vpn-rx-packets": 0, "vpn-tx-bytes": 0, "vpn-tx-packets": 0, "link-rx-bytes": 0, "link-rx-packets": 0, "link-tx-bytes": 0, "link-tx-packets": 0}}}
diff --git a/tools/testing/selftests/net/ovpn/ovpn-cli.c b/tools/testing/selftests/net/ovpn/ovpn-cli.c
index f4effa7580c0f..6b458a654a337 100644
--- a/tools/testing/selftests/net/ovpn/ovpn-cli.c
+++ b/tools/testing/selftests/net/ovpn/ovpn-cli.c
@@ -470,6 +470,18 @@ static int ovpn_parse_key_direction(const char *dir, struct ovpn_ctx *ctx)
return 0;
}
+static int ovpn_tcp_nodelay(int socket)
+{
+ int opt = 1;
+ int ret;
+
+ ret = setsockopt(socket, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
+ if (ret < 0)
+ perror("setsockopt for TCP_NODELAY");
+
+ return ret;
+}
+
static int ovpn_socket(struct ovpn_ctx *ctx, sa_family_t family, int proto)
{
struct sockaddr_storage local_sock = { 0 };
@@ -606,6 +618,12 @@ static int ovpn_accept(struct ovpn_ctx *ctx)
goto err;
}
+ if (ovpn_tcp_nodelay(ret) < 0) {
+ close(ret);
+ ret = -1;
+ goto err;
+ }
+
return ret;
err:
close(ctx->socket);
@@ -623,6 +641,10 @@ static int ovpn_connect(struct ovpn_ctx *ovpn)
return -1;
}
+ ret = ovpn_tcp_nodelay(s);
+ if (ret < 0)
+ goto err;
+
switch (ovpn->remote.in4.sin_family) {
case AF_INET:
socklen = sizeof(struct sockaddr_in);
diff --git a/tools/testing/selftests/net/ovpn/test.sh b/tools/testing/selftests/net/ovpn/test.sh
index 9b5610837032f..d744c1a97d5fc 100755
--- a/tools/testing/selftests/net/ovpn/test.sh
+++ b/tools/testing/selftests/net/ovpn/test.sh
@@ -67,35 +67,33 @@ ovpn_run_basic_traffic() {
local tcpdump_timeout="1.5s"
for p in $(seq 1 ${OVPN_NUM_PEERS}); do
- # The first part of the data packet header consists of:
- # - TCP only: 2 bytes for the packet length
- # - 5 bits for opcode ("9" for DATA_V2)
- # - 3 bits for key-id ("0" at this point)
- # - 12 bytes for peer-id:
- # - with asymmetric ID: "${p}" one way and "${p} + 9" the
- # other way
- # - with symmetric ID: "${p}" both ways
- header1=$(printf "0x4800000%x" ${p})
- header2=$(printf "0x4800000%x" $((p + OVPN_ID_OFFSET)))
- raddr=""
if [ "${OVPN_PROTO}" == "UDP" ]; then
+ # The first part of the data packet header consists of:
+ # - 5 bits for opcode ("9" for DATA_V2)
+ # - 3 bits for key-id ("0" at this point)
+ # - 3 bytes for peer-id:
+ # - with asymmetric ID: "${p}" one way and "${p} + 9" the
+ # other way
+ # - with symmetric ID: "${p}" both ways
+ header1=$(printf "0x4800000%x" ${p})
+ header2=$(printf "0x4800000%x" $((p + OVPN_ID_OFFSET)))
raddr=$(awk "NR == ${p} {print \$3}" \
"${OVPN_UDP_PEERS_FILE}")
+ peer_ns="ovpn_peer${p}"
+
+ timeout ${tcpdump_timeout} ip netns exec "${peer_ns}" \
+ tcpdump --immediate-mode -p -ni veth${p} -c 1 \
+ "$(ovpn_build_capture_filter "${header1}" "${raddr}")" \
+ >/dev/null 2>&1 &
+ tcpdump_pid1=$!
+ timeout ${tcpdump_timeout} ip netns exec "${peer_ns}" \
+ tcpdump --immediate-mode -p -ni veth${p} -c 1 \
+ "$(ovpn_build_capture_filter "${header2}" "${raddr}")" \
+ >/dev/null 2>&1 &
+ tcpdump_pid2=$!
+
+ sleep 0.3
fi
- peer_ns="ovpn_peer${p}"
-
- timeout ${tcpdump_timeout} ip netns exec "${peer_ns}" \
- tcpdump --immediate-mode -p -ni veth${p} -c 1 \
- "$(ovpn_build_capture_filter "${header1}" "${raddr}")" \
- >/dev/null 2>&1 &
- tcpdump_pid1=$!
- timeout ${tcpdump_timeout} ip netns exec "${peer_ns}" \
- tcpdump --immediate-mode -p -ni veth${p} -c 1 \
- "$(ovpn_build_capture_filter "${header2}" "${raddr}")" \
- >/dev/null 2>&1 &
- tcpdump_pid2=$!
-
- sleep 0.3
ovpn_cmd_ok "send baseline traffic to peer ${p}" \
ip netns exec ovpn_peer0 \
ping -qfc 100 -w 3 5.5.5.$((p + 1))
@@ -103,8 +101,10 @@ ovpn_run_basic_traffic() {
ip netns exec ovpn_peer0 \
ping -qfc 100 -s 3000 -w 3 5.5.5.$((p + 1))
- wait "${tcpdump_pid1}" || return 1
- wait "${tcpdump_pid2}" || return 1
+ if [ "${OVPN_PROTO}" == "UDP" ]; then
+ wait "${tcpdump_pid1}" || return 1
+ wait "${tcpdump_pid2}" || return 1
+ fi
done
}
|
| 53/3 | 2026/09/24 08:01 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 16788 output: 40 thoughts: 742 Thoughts: **Analyzing the OVPN Patch for KMSAN Fuzzing Potential** Okay, let's dive into this patch and figure out if we need to fire up a KMSAN fuzzing session. My first step is always a quick scan of the changed files. I see we have modifications in `drivers/net/ovpn/bind.c`, `io.c`, `netlink.c`, `socket.h`, and some selftests. The `bind.c` change seems straightforward; it's a doc comment update and an adjustment to the return value, moving from finding an existing bind to creating a new one or returning an error. Nothing jumps out as immediately problematic for memory safety. The `io.c` changes are just removing an `if (likely(peer))` check before calling `ovpn_peer_put`. This simplifies the code, but I don't see any obvious new vulnerabilities here either. The core functionality seems unchanged. Now, `netlink.c`... this is where things get interesting. I see a refactoring of `ovpn_nl_send_peer`, with attribute filling logic extracted into `ovpn_nl_fill_peer`. I'm immediately paying attention to the NULL check on `info` in `ovpn_nl_fill_peer`. It looks like `ovpn_nl_peer_del_notify` now calls `ovpn_nl_fill_peer` with a NULL `info`. This is a significant change because it used to send a smaller set of attributes. The fact that the code is changing what's passed and what is potentially dereferenced with `info` could be a vulnerability. I need to examine `ovpn_nl_fill_peer` closely. I'm going to use `read-file` to get the context of what attributes are filled and how they are handled. I see it's also using a `struct sk_buff`. The `socket.h` change removing an unused member from the `ovpn_socket` struct is just cleanup, doesn't seem to be an issue. Since the `netlink.c` change is the most complex, I need to read the code around lines 546-660 and around line 1193 to understand what attributes are being filled in the new function, to see what `NULL` can be passed there, and how it will be processed. I'll read and analyze all these changes to determine if any of them present potential memory safety issues that warrant KMSAN attention. Specifically, the null `info` in `ovpn_nl_peer_del_notify` calls. This looks like a definite candidate for further investigation. |
| 54/3 | 2026/09/24 08:01 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/netlink.c",
"FirstLine": 540,
"LineCount": 100
}Results: {
"Contents": " 540:\t\t */\n 541:\t\tif (attrs[OVPN_A_PEER_REMOTE_IPV4] || attrs[OVPN_A_PEER_REMOTE_IPV6])\n 542:\t\t\tovpn_peer_hash_transp_addr(peer);\n 543:\t\tspin_unlock_bh(\u0026ovpn-\u003elock);\n 544:\t\tovpn_peer_put(peer);\n 545:\t\n 546:\t\treturn 0;\n 547:\t}\n 548:\t\n 549:\tstatic int ovpn_nl_fill_peer(struct sk_buff *skb, const struct genl_info *info,\n 550:\t\t\t\t const struct ovpn_peer *peer)\n 551:\t{\n 552:\t\tconst struct ovpn_bind *bind;\n 553:\t\tstruct ovpn_socket *sock;\n 554:\t\tint ret = -EMSGSIZE;\n 555:\t\t__be16 local_port;\n 556:\t\tint id;\n 557:\t\n 558:\t\trcu_read_lock();\n 559:\t\tsock = rcu_dereference(peer-\u003esock);\n 560:\t\tif (!sock) {\n 561:\t\t\tret = -EINVAL;\n 562:\t\t\tgoto err_unlock;\n 563:\t\t}\n 564:\t\n 565:\t\tif (info \u0026\u0026 !net_eq(genl_info_net(info), sock_net(sock-\u003esk))) {\n 566:\t\t\tid = peernet2id_alloc(genl_info_net(info),\n 567:\t\t\t\t\t sock_net(sock-\u003esk),\n 568:\t\t\t\t\t GFP_ATOMIC);\n 569:\t\t\tif (nla_put_s32(skb, OVPN_A_PEER_SOCKET_NETNSID, id))\n 570:\t\t\t\tgoto err_unlock;\n 571:\t\t}\n 572:\t\tlocal_port = inet_sk(sock-\u003esk)-\u003einet_sport;\n 573:\t\trcu_read_unlock();\n 574:\t\n 575:\t\tif (nla_put_u32(skb, OVPN_A_PEER_ID, peer-\u003eid))\n 576:\t\t\treturn -EMSGSIZE;\n 577:\t\n 578:\t\tif (nla_put_u32(skb, OVPN_A_PEER_TX_ID, peer-\u003etx_id))\n 579:\t\t\treturn -EMSGSIZE;\n 580:\t\n 581:\t\tif (peer-\u003evpn_addrs.ipv4.s_addr != htonl(INADDR_ANY))\n 582:\t\t\tif (nla_put_in_addr(skb, OVPN_A_PEER_VPN_IPV4,\n 583:\t\t\t\t\t peer-\u003evpn_addrs.ipv4.s_addr))\n 584:\t\t\t\treturn -EMSGSIZE;\n 585:\t\n 586:\t\tif (!ipv6_addr_equal(\u0026peer-\u003evpn_addrs.ipv6, \u0026in6addr_any))\n 587:\t\t\tif (nla_put_in6_addr(skb, OVPN_A_PEER_VPN_IPV6,\n 588:\t\t\t\t\t \u0026peer-\u003evpn_addrs.ipv6))\n 589:\t\t\t\treturn -EMSGSIZE;\n 590:\t\n 591:\t\tif (nla_put_u32(skb, OVPN_A_PEER_KEEPALIVE_INTERVAL,\n 592:\t\t\t\tpeer-\u003ekeepalive_interval) ||\n 593:\t\t nla_put_u32(skb, OVPN_A_PEER_KEEPALIVE_TIMEOUT,\n 594:\t\t\t\tpeer-\u003ekeepalive_timeout))\n 595:\t\t\treturn -EMSGSIZE;\n 596:\t\n 597:\t\trcu_read_lock();\n 598:\t\tbind = rcu_dereference(peer-\u003ebind);\n 599:\t\tif (bind) {\n 600:\t\t\tif (bind-\u003eremote.in4.sin_family == AF_INET) {\n 601:\t\t\t\tif (nla_put_in_addr(skb, OVPN_A_PEER_REMOTE_IPV4,\n 602:\t\t\t\t\t\t bind-\u003eremote.in4.sin_addr.s_addr) ||\n 603:\t\t\t\t nla_put_net16(skb, OVPN_A_PEER_REMOTE_PORT,\n 604:\t\t\t\t\t\t bind-\u003eremote.in4.sin_port) ||\n 605:\t\t\t\t nla_put_in_addr(skb, OVPN_A_PEER_LOCAL_IPV4,\n 606:\t\t\t\t\t\t bind-\u003elocal.ipv4.s_addr))\n 607:\t\t\t\t\tgoto err_unlock;\n 608:\t\t\t} else if (bind-\u003eremote.in4.sin_family == AF_INET6) {\n 609:\t\t\t\tif (nla_put_in6_addr(skb, OVPN_A_PEER_REMOTE_IPV6,\n 610:\t\t\t\t\t\t \u0026bind-\u003eremote.in6.sin6_addr) ||\n 611:\t\t\t\t nla_put_u32(skb, OVPN_A_PEER_REMOTE_IPV6_SCOPE_ID,\n 612:\t\t\t\t\t\tbind-\u003eremote.in6.sin6_scope_id) ||\n 613:\t\t\t\t nla_put_net16(skb, OVPN_A_PEER_REMOTE_PORT,\n 614:\t\t\t\t\t\t bind-\u003eremote.in6.sin6_port) ||\n 615:\t\t\t\t nla_put_in6_addr(skb, OVPN_A_PEER_LOCAL_IPV6,\n 616:\t\t\t\t\t\t \u0026bind-\u003elocal.ipv6))\n 617:\t\t\t\t\tgoto err_unlock;\n 618:\t\t\t}\n 619:\t\t}\n 620:\t\trcu_read_unlock();\n 621:\t\n 622:\t\tif (nla_put_net16(skb, OVPN_A_PEER_LOCAL_PORT, local_port) ||\n 623:\t\t /* VPN RX stats */\n 624:\t\t nla_put_uint(skb, OVPN_A_PEER_VPN_RX_BYTES,\n 625:\t\t\t\t atomic64_read(\u0026peer-\u003evpn_stats.rx.bytes)) ||\n 626:\t\t nla_put_uint(skb, OVPN_A_PEER_VPN_RX_PACKETS,\n 627:\t\t\t\t atomic64_read(\u0026peer-\u003evpn_stats.rx.packets)) ||\n 628:\t\t /* VPN TX stats */\n 629:\t\t nla_put_uint(skb, OVPN_A_PEER_VPN_TX_BYTES,\n 630:\t\t\t\t atomic64_read(\u0026peer-\u003evpn_stats.tx.bytes)) ||\n 631:\t\t nla_put_uint(skb, OVPN_A_PEER_VPN_TX_PACKETS,\n 632:\t\t\t\t atomic64_read(\u0026peer-\u003evpn_stats.tx.packets)) ||\n 633:\t\t /* link RX stats */\n 634:\t\t nla_put_uint(skb, OVPN_A_PEER_LINK_RX_BYTES,\n 635:\t\t\t\t atomic64_read(\u0026peer-\u003elink_stats.rx.bytes)) ||\n 636:\t\t nla_put_uint(skb, OVPN_A_PEER_LINK_RX_PACKETS,\n 637:\t\t\t\t atomic64_read(\u0026peer-\u003elink_stats.rx.packets)) ||\n 638:\t\t /* link TX stats */\n 639:\t\t nla_put_uint(skb, OVPN_A_PEER_LINK_TX_BYTES,\n"
} |
| 55/3 | 2026/09/24 08:01 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 20153 output: 40 thoughts: 37 Thoughts: Okay, here's my interpretation of that thought process, tailored for an expert audience, and presented as if it were my own internal monologue: **Diving Deeper into the OpenVPN Netlink Interface** Right, so we're looking at the OpenVPN netlink interface. I need to get a really solid grasp on this area, and I think a specific section of the driver code will be most helpful to me right now. Let's see... I'm thinking I should use `read-file` to zero in on lines 1180 through 1230 of `drivers/net/ovpn/netlink.c`. I have a feeling the interaction with netlink is concentrated there, probably handling some key aspect of the netlink interaction. This section will hopefully give me context I need to resolve this issue I'm working on. The exact logic in that section should be immediately relevant to what I'm currently looking at, and a quick examination should clarify its functionality. |
| 56/3 | 2026/09/24 08:01 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/netlink.c",
"FirstLine": 1180,
"LineCount": 50
}Results: {
"Contents": "1180:\t\tstruct ovpn_socket *sock;\n1181:\t\tstruct sk_buff *msg;\n1182:\t\tstruct nlattr *attr;\n1183:\t\tint ret = -EMSGSIZE;\n1184:\t\tvoid *hdr;\n1185:\t\n1186:\t\tnetdev_info(peer-\u003eovpn-\u003edev, \"deleting peer with id %u, reason %d\\n\",\n1187:\t\t\t peer-\u003eid, peer-\u003edelete_reason);\n1188:\t\n1189:\t\tmsg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);\n1190:\t\tif (!msg)\n1191:\t\t\treturn -ENOMEM;\n1192:\t\n1193:\t\thdr = genlmsg_put(msg, 0, 0, \u0026ovpn_nl_family, 0, OVPN_CMD_PEER_DEL_NTF);\n1194:\t\tif (!hdr) {\n1195:\t\t\tret = -ENOBUFS;\n1196:\t\t\tgoto err_free_msg;\n1197:\t\t}\n1198:\t\n1199:\t\tif (nla_put_u32(msg, OVPN_A_IFINDEX, peer-\u003eovpn-\u003edev-\u003eifindex))\n1200:\t\t\tgoto err_cancel_msg;\n1201:\t\n1202:\t\tattr = nla_nest_start(msg, OVPN_A_PEER);\n1203:\t\tif (!attr)\n1204:\t\t\tgoto err_cancel_msg;\n1205:\t\n1206:\t\tif (nla_put_u32(msg, OVPN_A_PEER_DEL_REASON, peer-\u003edelete_reason))\n1207:\t\t\tgoto err_cancel_msg;\n1208:\t\n1209:\t\tret = ovpn_nl_fill_peer(msg, NULL, peer);\n1210:\t\tif (ret \u003c 0)\n1211:\t\t\tgoto err_cancel_msg;\n1212:\t\n1213:\t\tnla_nest_end(msg, attr);\n1214:\t\n1215:\t\tgenlmsg_end(msg, hdr);\n1216:\t\n1217:\t\trcu_read_lock();\n1218:\t\tsock = rcu_dereference(peer-\u003esock);\n1219:\t\tif (!sock) {\n1220:\t\t\tret = -EINVAL;\n1221:\t\t\tgoto err_unlock;\n1222:\t\t}\n1223:\t\tgenlmsg_multicast_netns(\u0026ovpn_nl_family, sock_net(sock-\u003esk), msg, 0,\n1224:\t\t\t\t\tOVPN_NLGRP_PEERS, GFP_ATOMIC);\n1225:\t\trcu_read_unlock();\n1226:\t\n1227:\t\treturn 0;\n1228:\t\n1229:\terr_unlock:\n"
} |
| 57/3 | 2026/09/24 08:01 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 21216 output: 38 thoughts: 48 Thoughts: Okay, let's dive into this. Here's my take on those `ovpn` driver functions: **Investigating the "if (likely(peer))" Removal in the `ovpn` Driver** Alright, I'm going to shift gears and focus on the `drivers/net/ovpn/io.c` file. I need to understand why they removed the `if (likely(peer))` check. My instincts tell me that this wasn't a casual decision; there's probably a performance implication or a subtle bug fix at play here. Let's start by scrutinizing the `ovpn_decrypt_post` and `ovpn_encrypt_post` functions. I'll need to carefully dissect the code around the removal, examining how the `peer` variable is used, what contexts it's checked in, and any potential side effects of its absence. I'm looking for clues about how this change might impact data flow, error handling, and overall throughput. Specifically, I'll be looking for any indications that the `peer` check was either redundant, had a significant performance cost that was optimized away, or that it was masking an actual logic error that required more robust handling. Once I see the code, I expect to be able to immediately assess whether the change seems correct or whether it warrants further investigation. I'm going to look for any hidden flags or preprocessor macros that might conditionally enable/disable the behavior too. |
| 58/3 | 2026/09/24 08:01 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/io.c",
"FirstLine": 195,
"LineCount": 50
}Results: {
"Contents": " 195:\t\t\t\t\t\t peer-\u003eid, \u0026ip_hdr(skb)-\u003esaddr);\n 196:\t\t\tgoto drop;\n 197:\t\t}\n 198:\t\n 199:\t\tovpn_netdev_write(peer, skb);\n 200:\t\t/* skb is passed to upper layer - don't free it */\n 201:\t\tskb = NULL;\n 202:\tdrop:\n 203:\t\tif (unlikely(skb))\n 204:\t\t\tovpn_dev_dstats_rx_dropped(peer-\u003eovpn-\u003edev);\n 205:\t\tkfree_skb(skb);\n 206:\tdrop_nocount:\n 207:\t\tif (likely(ks))\n 208:\t\t\tovpn_crypto_key_slot_put(ks);\n 209:\t\tovpn_peer_put(peer);\n 210:\t}\n 211:\t\n 212:\t/* RX path entry point: decrypt packet and forward it to the device */\n 213:\tvoid ovpn_recv(struct ovpn_peer *peer, struct sk_buff *skb)\n 214:\t{\n 215:\t\tstruct ovpn_crypto_key_slot *ks;\n 216:\t\tu8 key_id;\n 217:\t\n 218:\t\tovpn_peer_stats_increment_rx(\u0026peer-\u003elink_stats, skb-\u003elen);\n 219:\t\n 220:\t\t/* get the key slot matching the key ID in the received packet */\n 221:\t\tkey_id = ovpn_key_id_from_skb(skb);\n 222:\t\tks = ovpn_crypto_key_id_to_slot(\u0026peer-\u003ecrypto, key_id);\n 223:\t\tif (unlikely(!ks)) {\n 224:\t\t\tnet_info_ratelimited(\"%s: no available key for peer %u, key-id: %u\\n\",\n 225:\t\t\t\t\t netdev_name(peer-\u003eovpn-\u003edev), peer-\u003eid,\n 226:\t\t\t\t\t key_id);\n 227:\t\t\tovpn_dev_dstats_rx_dropped(peer-\u003eovpn-\u003edev);\n 228:\t\t\tkfree_skb(skb);\n 229:\t\t\tovpn_peer_put(peer);\n 230:\t\t\treturn;\n 231:\t\t}\n 232:\t\n 233:\t\tmemset(ovpn_skb_cb(skb), 0, sizeof(struct ovpn_cb));\n 234:\t\tovpn_decrypt_post(skb, ovpn_aead_decrypt(peer, ks, skb));\n 235:\t}\n 236:\t\n 237:\tvoid ovpn_encrypt_post(void *data, int ret)\n 238:\t{\n 239:\t\tstruct ovpn_crypto_key_slot *ks;\n 240:\t\tstruct sk_buff *skb = data;\n 241:\t\tstruct ovpn_socket *sock;\n 242:\t\tstruct ovpn_peer *peer;\n 243:\t\tunsigned int orig_len;\n 244:\t\n"
} |
| 59/3 | 2026/09/24 08:01 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 22435 output: 38 thoughts: 14 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience: **Deep Dive: `ovpn_encrypt_post` Analysis** Alright, time to meticulously dissect `ovpn_encrypt_post`. This function, at its core, handles the critical task of encrypting data *after* the initial connection phase, likely during the actual data transfer stage within OpenVPN. I need to ensure it's robust, secure, and efficient. I'm thinking: * **Security Audit:** First, a granular security audit is required. I need to trace *every* input it receives, understand the origins of this data, and meticulously check if there are any potential vulnerabilities, such as buffer overflows, cryptographic side-channel leaks, or any flaws in the implementation. This means considering how it handles key derivation, IV generation, and the selected ciphers themselves. Is it using modern, authenticated encryption modes? Are the cryptographic libraries employed properly? * **Performance Optimization:** Beyond security, performance is key. Given it's likely executed per packet, any inefficiency here will translate directly into bandwidth limitations. I need to consider factors that could be impacting speed, such as inefficient memory management, excessive copying, or non-optimal cryptographic algorithm choices. This might mean investigating assembly-level implementations or exploring alternative cipher configurations. I need to look for any potential bottlenecks, like excessive context switching or unnecessary system calls. * **Error Handling:** It has to be bulletproof. What happens if the encryption fails? How are errors signaled, and how are they handled upstream and downstream? A single, unhandled encryption failure can compromise the entire session, so robust error handling is paramount. Are there sufficient logging mechanisms to aid in debugging in the event of any issues? * **Interoperability:** I'll have to consider compatibility with various OpenVPN configurations, including different cipher suites, key lengths, and authentication protocols. Any deviation from expected behavior could break compatibility or introduce security vulnerabilities, so it has to be rigorously tested in a range of scenarios. * **Concurrency:** OpenVPN often involves multiple concurrent connections. I need to ensure that the `ovpn_encrypt_post` function is thread-safe and doesn't introduce any race conditions or data corruption issues in a multi-threaded environment. I will need to verify how any shared resources are managed. * **Code Review:** Finally, I'll need to meticulously review the code itself: its structure, coding style, comments, and any potential areas for improvement. I'll need to analyze the surrounding code. This will allow for the identification of potential errors or security vulnerabilities. My goal here is to make sure this function, and by extension OpenVPN, can stand up to scrutiny from both attackers and performance demands. |
| 60/3 | 2026/09/24 08:02 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/io.c",
"FirstLine": 240,
"LineCount": 75
}Results: {
"Contents": " 240:\t\tstruct sk_buff *skb = data;\n 241:\t\tstruct ovpn_socket *sock;\n 242:\t\tstruct ovpn_peer *peer;\n 243:\t\tunsigned int orig_len;\n 244:\t\n 245:\t\t/* encryption is happening asynchronously. This function will be\n 246:\t\t * called later by the crypto callback with a proper return value\n 247:\t\t */\n 248:\t\tif (unlikely(ret == -EINPROGRESS))\n 249:\t\t\treturn;\n 250:\t\n 251:\t\tks = ovpn_skb_cb(skb)-\u003eks;\n 252:\t\tpeer = ovpn_skb_cb(skb)-\u003epeer;\n 253:\t\n 254:\t\t/* crypto is done, cleanup skb CB and its members */\n 255:\t\tkfree(ovpn_skb_cb(skb)-\u003ecrypto_tmp);\n 256:\t\n 257:\t\tif (unlikely(ret == -ERANGE)) {\n 258:\t\t\t/* we ran out of IVs and we must kill the key as it can't be\n 259:\t\t\t * use anymore\n 260:\t\t\t */\n 261:\t\t\tnetdev_warn(peer-\u003eovpn-\u003edev,\n 262:\t\t\t\t \"killing key %u for peer %u\\n\", ks-\u003ekey_id,\n 263:\t\t\t\t peer-\u003eid);\n 264:\t\t\tif (ovpn_crypto_kill_key(\u0026peer-\u003ecrypto, ks-\u003ekey_id))\n 265:\t\t\t\t/* let userspace know so that a new key must be negotiated */\n 266:\t\t\t\tovpn_nl_key_swap_notify(peer, ks-\u003ekey_id);\n 267:\t\n 268:\t\t\tgoto err;\n 269:\t\t}\n 270:\t\n 271:\t\tif (unlikely(ret \u003c 0))\n 272:\t\t\tgoto err;\n 273:\t\n 274:\t\tskb_mark_not_on_list(skb);\n 275:\t\torig_len = skb-\u003elen;\n 276:\t\n 277:\t\trcu_read_lock();\n 278:\t\tsock = rcu_dereference(peer-\u003esock);\n 279:\t\tif (unlikely(!sock))\n 280:\t\t\tgoto err_unlock;\n 281:\t\n 282:\t\tswitch (sock-\u003esk-\u003esk_protocol) {\n 283:\t\tcase IPPROTO_UDP:\n 284:\t\t\tovpn_udp_send_skb(peer, sock-\u003esk, skb);\n 285:\t\t\tbreak;\n 286:\t\tcase IPPROTO_TCP:\n 287:\t\t\tovpn_tcp_send_skb(peer, sock-\u003esk, skb);\n 288:\t\t\tbreak;\n 289:\t\tdefault:\n 290:\t\t\t/* no transport configured yet */\n 291:\t\t\tgoto err_unlock;\n 292:\t\t}\n 293:\t\n 294:\t\tovpn_peer_stats_increment_tx(\u0026peer-\u003elink_stats, orig_len);\n 295:\t\t/* keep track of last sent packet for keepalive */\n 296:\t\tWRITE_ONCE(peer-\u003elast_sent, ktime_get_boottime_seconds());\n 297:\t\t/* skb passed down the stack - don't free it */\n 298:\t\tskb = NULL;\n 299:\terr_unlock:\n 300:\t\trcu_read_unlock();\n 301:\terr:\n 302:\t\tif (unlikely(skb))\n 303:\t\t\tovpn_dev_dstats_tx_dropped(peer-\u003eovpn-\u003edev);\n 304:\t\tkfree_skb(skb);\n 305:\t\tif (likely(ks))\n 306:\t\t\tovpn_crypto_key_slot_put(ks);\n 307:\t\tovpn_peer_put(peer);\n 308:\t}\n 309:\t\n 310:\tstatic bool ovpn_encrypt_one(struct ovpn_peer *peer, struct sk_buff *skb)\n 311:\t{\n 312:\t\tstruct ovpn_crypto_key_slot *ks;\n 313:\t\n 314:\t\t/* get primary key to be used for encrypting data */\n"
} |
| 61/3 | 2026/09/24 08:02 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 24203 output: 38 thoughts: 20 Thoughts: Here's my thought process, as if I were analyzing this code: **Investigating the Source of `peer` in `ovpn_decrypt_post`** Okay, so I need to track down where this `peer` variable is coming from within the `ovpn_decrypt_post` function. The goal here is to understand its origin and any potential influence it might have on the code's behavior, especially if there's any risk of unexpected values or vulnerabilities related to how it's being handled. Given my familiarity with OpenVPN, I'm expecting it to be related to the connection's peer information, but I need to confirm the exact mechanism. Let's see if the code readily reveals where it's being set or passed. I'll need to use my understanding of the typical OpenVPN data flow and this specific function's role in the decryption process to make some educated guesses and navigate the code effectively. Time to dig in and trace its lineage. |
| 62/3 | 2026/09/24 08:02 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/io.c",
"FirstLine": 150,
"LineCount": 50
}Results: {
"Contents": " 150:\t\t\t/* check if this peer changed local or remote endpoint */\n 151:\t\t\tovpn_peer_endpoints_update(peer, skb);\n 152:\t\trcu_read_unlock();\n 153:\t\n 154:\t\t/* point to encapsulated IP packet */\n 155:\t\t__skb_pull(skb, payload_offset);\n 156:\t\n 157:\t\t/* check if this is a valid datapacket that has to be delivered to the\n 158:\t\t * ovpn interface\n 159:\t\t */\n 160:\t\tskb_reset_network_header(skb);\n 161:\t\tproto = ovpn_ip_check_protocol(skb);\n 162:\t\tif (unlikely(!proto)) {\n 163:\t\t\t/* check if null packet */\n 164:\t\t\tif (unlikely(!pskb_may_pull(skb, 1))) {\n 165:\t\t\t\tnet_info_ratelimited(\"%s: NULL packet received from peer %u\\n\",\n 166:\t\t\t\t\t\t netdev_name(peer-\u003eovpn-\u003edev),\n 167:\t\t\t\t\t\t peer-\u003eid);\n 168:\t\t\t\tgoto drop;\n 169:\t\t\t}\n 170:\t\n 171:\t\t\tif (ovpn_is_keepalive(skb)) {\n 172:\t\t\t\tnet_dbg_ratelimited(\"%s: ping received from peer %u\\n\",\n 173:\t\t\t\t\t\t netdev_name(peer-\u003eovpn-\u003edev),\n 174:\t\t\t\t\t\t peer-\u003eid);\n 175:\t\t\t\t/* we drop the packet, but this is not a failure */\n 176:\t\t\t\tconsume_skb(skb);\n 177:\t\t\t\tgoto drop_nocount;\n 178:\t\t\t}\n 179:\t\n 180:\t\t\tnet_info_ratelimited(\"%s: unsupported protocol received from peer %u\\n\",\n 181:\t\t\t\t\t netdev_name(peer-\u003eovpn-\u003edev), peer-\u003eid);\n 182:\t\t\tgoto drop;\n 183:\t\t}\n 184:\t\tskb-\u003eprotocol = proto;\n 185:\t\n 186:\t\t/* perform Reverse Path Filtering (RPF) */\n 187:\t\tif (unlikely(!ovpn_peer_check_by_src(peer-\u003eovpn, skb, peer))) {\n 188:\t\t\tif (skb-\u003eprotocol == htons(ETH_P_IPV6))\n 189:\t\t\t\tnet_dbg_ratelimited(\"%s: RPF dropped packet from peer %u, src: %pI6c\\n\",\n 190:\t\t\t\t\t\t netdev_name(peer-\u003eovpn-\u003edev),\n 191:\t\t\t\t\t\t peer-\u003eid, \u0026ipv6_hdr(skb)-\u003esaddr);\n 192:\t\t\telse\n 193:\t\t\t\tnet_dbg_ratelimited(\"%s: RPF dropped packet from peer %u, src: %pI4\\n\",\n 194:\t\t\t\t\t\t netdev_name(peer-\u003eovpn-\u003edev),\n 195:\t\t\t\t\t\t peer-\u003eid, \u0026ip_hdr(skb)-\u003esaddr);\n 196:\t\t\tgoto drop;\n 197:\t\t}\n 198:\t\n 199:\t\tovpn_netdev_write(peer, skb);\n"
} |
| 63/3 | 2026/09/24 08:02 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 25317 output: 38 thoughts: 15 Thoughts: Okay, here's my summary, presented as a stream of thought: **Diving into `ovpn_decrypt_post`** Alright, let's get started. The first thing I need to do is get a good handle on `ovpn_decrypt_post`. Where does this routine begin? What's the entry point? I need to understand its role in the overall OpenVPN decryption process. It's crucial to grasp the function's scope right from the start. That initial overview will dictate how I approach the rest of this analysis. I'm going to pay close attention to the flow, and what the initial actions are. |
| 64/3 | 2026/09/24 08:02 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/io.c",
"FirstLine": 115,
"LineCount": 40
}Results: {
"Contents": " 115:\t\t__be16 proto;\n 116:\t\t__be32 *pid;\n 117:\t\n 118:\t\t/* crypto is happening asynchronously. this function will be called\n 119:\t\t * again later by the crypto callback with a proper return code\n 120:\t\t */\n 121:\t\tif (unlikely(ret == -EINPROGRESS))\n 122:\t\t\treturn;\n 123:\t\n 124:\t\tpayload_offset = ovpn_skb_cb(skb)-\u003epayload_offset;\n 125:\t\tks = ovpn_skb_cb(skb)-\u003eks;\n 126:\t\tpeer = ovpn_skb_cb(skb)-\u003epeer;\n 127:\t\n 128:\t\t/* crypto is done, cleanup skb CB and its members */\n 129:\t\tkfree(ovpn_skb_cb(skb)-\u003ecrypto_tmp);\n 130:\t\n 131:\t\tif (unlikely(ret \u003c 0))\n 132:\t\t\tgoto drop;\n 133:\t\n 134:\t\t/* PID sits after the op */\n 135:\t\tpid = (__force __be32 *)(skb-\u003edata + OVPN_OPCODE_SIZE);\n 136:\t\tret = ovpn_pktid_recv(\u0026ks-\u003epid_recv, ntohl(*pid), 0);\n 137:\t\tif (unlikely(ret \u003c 0)) {\n 138:\t\t\tnet_err_ratelimited(\"%s: PKT ID RX error for peer %u: %d\\n\",\n 139:\t\t\t\t\t netdev_name(peer-\u003eovpn-\u003edev), peer-\u003eid,\n 140:\t\t\t\t\t ret);\n 141:\t\t\tgoto drop;\n 142:\t\t}\n 143:\t\n 144:\t\t/* keep track of last received authenticated packet for keepalive */\n 145:\t\tWRITE_ONCE(peer-\u003elast_recv, ktime_get_boottime_seconds());\n 146:\t\n 147:\t\trcu_read_lock();\n 148:\t\tsock = rcu_dereference(peer-\u003esock);\n 149:\t\tif (sock \u0026\u0026 sock-\u003esk-\u003esk_protocol == IPPROTO_UDP)\n 150:\t\t\t/* check if this peer changed local or remote endpoint */\n 151:\t\t\tovpn_peer_endpoints_update(peer, skb);\n 152:\t\trcu_read_unlock();\n 153:\t\n 154:\t\t/* point to encapsulated IP packet */\n"
} |
| 65/3 | 2026/09/24 08:02 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 26164 output: 32 thoughts: 2219 Thoughts: **Analyzing OpenVPN Peer Deletion Notification** Okay, let's break this down. In the encryption/decryption post-processing functions, the `peer` pointer is consistently valid before reaching the `drop_nocount` call, meaning the `if (likely(peer))` check is merely a cleanup step. That's straightforward. Now, shifting focus to `bind.c`, I see only a documentation comment change. The same holds true for `socket.h`, where they've simply removed an unused member, `work`, from the `ovpn_socket` struct. These are low-impact modifications. The real meat is in `netlink.c`, specifically `ovpn_nl_peer_del_notify`. I need to understand this `ovpn_nl_fill_peer` function more closely, especially when `info` is `NULL`. The code suggests it's sending a notification about a peer deletion. I'm paying close attention to which attributes are being sent to userspace. My concern is whether any uninitialized memory is being read during the attribute packing process. The code's using scalar value puts: `nla_put_u32`, `nla_put_in_addr`, `nla_put_in6_addr`, `nla_put_net16`, and `nla_put_uint`. Now, I need to verify: the addresses `bind->remote.in6.sin6_addr` and `peer->vpn_addrs.ipv6`. I need to trace their allocation and initialization to be absolutely certain we're not leaking any information. Time to break out `grepper` and see where these structures are allocated and populated. |
| 66/3 | 2026/09/24 08:02 | tool | grepper |
0mError:no matches Args: {
"Expression": "ovpn_peer_create",
"PathPrefix": "drivers/net/ovpn"
}Results: {
"error": "no matches"
} |
| 67/3 | 2026/09/24 08:02 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 28792 output: 32 thoughts: 16 Thoughts: Okay, here's my summary, tailored for an expert audience, as if I'm thinking these things myself: **Tracing the Genesis of `ovpn_peer`** Alright, let's dive in. I need to pinpoint the allocation or initialization of this `ovpn_peer` structure. It's a critical component, and understanding its lifecycle is paramount to grasping the behavior of the system. I'm going to start by using my standard investigative approach. I’ll leverage my knowledge of the codebase to rapidly understand what's happening. I expect there might be a few locations, possibly even conditionally. I am going to identify the entry points and the flow, to quickly understand how the structure evolves. |
| 68/3 | 2026/09/24 08:02 | tool | grepper |
0mArgs:{
"Expression": "struct ovpn_peer \\*",
"PathPrefix": "drivers/net/ovpn"
}Results: {
"Output": "\nFull output is too long, showing 500 out of 536 lines.\nUse more precise expression if possible.\n\ndrivers/net/ovpn/bind.c=23=struct ovpn_bind *ovpn_bind_from_sockaddr(const struct sockaddr_storage *ss)\n--\ndrivers/net/ovpn/bind.c-48- */\ndrivers/net/ovpn/bind.c:49:void ovpn_bind_reset(struct ovpn_peer *peer, struct ovpn_bind *new)\ndrivers/net/ovpn/bind.c-50-{\n--\ndrivers/net/ovpn/bind.h=98=struct ovpn_bind *ovpn_bind_from_sockaddr(const struct sockaddr_storage *sa);\ndrivers/net/ovpn/bind.h:99:void ovpn_bind_reset(struct ovpn_peer *peer, struct ovpn_bind *bind);\ndrivers/net/ovpn/bind.h-100-\n--\ndrivers/net/ovpn/crypto_aead.c=130=static struct scatterlist *ovpn_aead_crypto_req_sg(struct crypto_aead *aead,\n--\ndrivers/net/ovpn/crypto_aead.c-137-\ndrivers/net/ovpn/crypto_aead.c:138:int ovpn_aead_encrypt(struct ovpn_peer *peer, struct ovpn_crypto_key_slot *ks,\ndrivers/net/ovpn/crypto_aead.c-139-\t\t struct sk_buff *skb)\n--\ndrivers/net/ovpn/crypto_aead.c-240-\ndrivers/net/ovpn/crypto_aead.c:241:int ovpn_aead_decrypt(struct ovpn_peer *peer, struct ovpn_crypto_key_slot *ks,\ndrivers/net/ovpn/crypto_aead.c-242-\t\t struct sk_buff *skb)\n--\ndrivers/net/ovpn/crypto_aead.h-17-\ndrivers/net/ovpn/crypto_aead.h:18:int ovpn_aead_encrypt(struct ovpn_peer *peer, struct ovpn_crypto_key_slot *ks,\ndrivers/net/ovpn/crypto_aead.h-19-\t\t struct sk_buff *skb);\ndrivers/net/ovpn/crypto_aead.h:20:int ovpn_aead_decrypt(struct ovpn_peer *peer, struct ovpn_crypto_key_slot *ks,\ndrivers/net/ovpn/crypto_aead.h-21-\t\t struct sk_buff *skb);\n--\ndrivers/net/ovpn/io.c=43=static bool ovpn_is_keepalive(struct sk_buff *skb)\n--\ndrivers/net/ovpn/io.c-59- */\ndrivers/net/ovpn/io.c:60:static void ovpn_netdev_write(struct ovpn_peer *peer, struct sk_buff *skb)\ndrivers/net/ovpn/io.c-61-{\n--\ndrivers/net/ovpn/io.c=108=void ovpn_decrypt_post(void *data, int ret)\n--\ndrivers/net/ovpn/io.c-113-\tstruct ovpn_socket *sock;\ndrivers/net/ovpn/io.c:114:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/io.c-115-\t__be16 proto;\n--\ndrivers/net/ovpn/io.c-212-/* RX path entry point: decrypt packet and forward it to the device */\ndrivers/net/ovpn/io.c:213:void ovpn_recv(struct ovpn_peer *peer, struct sk_buff *skb)\ndrivers/net/ovpn/io.c-214-{\n--\ndrivers/net/ovpn/io.c=237=void ovpn_encrypt_post(void *data, int ret)\n--\ndrivers/net/ovpn/io.c-241-\tstruct ovpn_socket *sock;\ndrivers/net/ovpn/io.c:242:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/io.c-243-\tunsigned int orig_len;\n--\ndrivers/net/ovpn/io.c-309-\ndrivers/net/ovpn/io.c:310:static bool ovpn_encrypt_one(struct ovpn_peer *peer, struct sk_buff *skb)\ndrivers/net/ovpn/io.c-311-{\n--\ndrivers/net/ovpn/io.c=334=static void ovpn_send(struct ovpn_priv *ovpn, struct sk_buff *skb,\ndrivers/net/ovpn/io.c:335:\t\t struct ovpn_peer *peer)\ndrivers/net/ovpn/io.c-336-{\n--\ndrivers/net/ovpn/io.c=354=netdev_tx_t ovpn_net_xmit(struct sk_buff *skb, struct net_device *dev)\n--\ndrivers/net/ovpn/io.c-359-\tunsigned int tx_bytes = 0;\ndrivers/net/ovpn/io.c:360:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/io.c-361-\t__be16 proto;\n--\ndrivers/net/ovpn/io.c-455- */\ndrivers/net/ovpn/io.c:456:void ovpn_xmit_special(struct ovpn_peer *peer, const void *data,\ndrivers/net/ovpn/io.c-457-\t\t const unsigned int len)\n--\ndrivers/net/ovpn/io.h=25=netdev_tx_t ovpn_net_xmit(struct sk_buff *skb, struct net_device *dev);\ndrivers/net/ovpn/io.h-26-\ndrivers/net/ovpn/io.h:27:void ovpn_recv(struct ovpn_peer *peer, struct sk_buff *skb);\ndrivers/net/ovpn/io.h:28:void ovpn_xmit_special(struct ovpn_peer *peer, const void *data,\ndrivers/net/ovpn/io.h-29-\t\t const unsigned int len);\n--\ndrivers/net/ovpn/netlink.c=182=static int ovpn_nl_peer_precheck(struct ovpn_priv *ovpn,\n--\ndrivers/net/ovpn/netlink.c-278- */\ndrivers/net/ovpn/netlink.c:279:static int ovpn_nl_peer_modify(struct ovpn_peer *peer, struct genl_info *info,\ndrivers/net/ovpn/netlink.c-280-\t\t\t struct nlattr **attrs)\n--\ndrivers/net/ovpn/netlink.c=347=int ovpn_nl_peer_new_doit(struct sk_buff *skb, struct genl_info *info)\n--\ndrivers/net/ovpn/netlink.c-352-\tstruct socket *sock = NULL;\ndrivers/net/ovpn/netlink.c:353:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/netlink.c-354-\tu32 sockfd, peer_id;\n--\ndrivers/net/ovpn/netlink.c=475=int ovpn_nl_peer_set_doit(struct sk_buff *skb, struct genl_info *info)\n--\ndrivers/net/ovpn/netlink.c-479-\tstruct ovpn_socket *sock;\ndrivers/net/ovpn/netlink.c:480:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/netlink.c-481-\tu32 peer_id;\n--\ndrivers/net/ovpn/netlink.c=549=static int ovpn_nl_fill_peer(struct sk_buff *skb, const struct genl_info *info,\ndrivers/net/ovpn/netlink.c:550:\t\t\t const struct ovpn_peer *peer)\ndrivers/net/ovpn/netlink.c-551-{\n--\ndrivers/net/ovpn/netlink.c=651=static int ovpn_nl_send_peer(struct sk_buff *skb, const struct genl_info *info,\ndrivers/net/ovpn/netlink.c:652:\t\t\t const struct ovpn_peer *peer, u32 portid, u32 seq,\ndrivers/net/ovpn/netlink.c-653-\t\t\t int flags)\n--\ndrivers/net/ovpn/netlink.c=681=int ovpn_nl_peer_get_doit(struct sk_buff *skb, struct genl_info *info)\n--\ndrivers/net/ovpn/netlink.c-684-\tstruct ovpn_priv *ovpn = info-\u003euser_ptr[0];\ndrivers/net/ovpn/netlink.c:685:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/netlink.c-686-\tstruct sk_buff *msg;\n--\ndrivers/net/ovpn/netlink.c=746=int ovpn_nl_peer_get_dumpit(struct sk_buff *skb, struct netlink_callback *cb)\n--\ndrivers/net/ovpn/netlink.c-751-\tstruct ovpn_priv *ovpn;\ndrivers/net/ovpn/netlink.c:752:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/netlink.c-753-\n--\ndrivers/net/ovpn/netlink.c=807=int ovpn_nl_peer_del_doit(struct sk_buff *skb, struct genl_info *info)\n--\ndrivers/net/ovpn/netlink.c-810-\tstruct ovpn_priv *ovpn = info-\u003euser_ptr[0];\ndrivers/net/ovpn/netlink.c:811:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/netlink.c-812-\tu32 peer_id;\n--\ndrivers/net/ovpn/netlink.c=906=int ovpn_nl_key_new_doit(struct sk_buff *skb, struct genl_info *info)\n--\ndrivers/net/ovpn/netlink.c-910-\tstruct ovpn_peer_key_reset pkr;\ndrivers/net/ovpn/netlink.c:911:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/netlink.c-912-\tu32 peer_id;\n--\ndrivers/net/ovpn/netlink.c=1011=int ovpn_nl_key_get_doit(struct sk_buff *skb, struct genl_info *info)\n--\ndrivers/net/ovpn/netlink.c-1016-\tenum ovpn_key_slot slot;\ndrivers/net/ovpn/netlink.c:1017:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/netlink.c-1018-\tstruct sk_buff *msg;\n--\ndrivers/net/ovpn/netlink.c=1093=int ovpn_nl_key_swap_doit(struct sk_buff *skb, struct genl_info *info)\n--\ndrivers/net/ovpn/netlink.c-1096-\tstruct ovpn_priv *ovpn = info-\u003euser_ptr[0];\ndrivers/net/ovpn/netlink.c:1097:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/netlink.c-1098-\tu32 peer_id;\n--\ndrivers/net/ovpn/netlink.c=1129=int ovpn_nl_key_del_doit(struct sk_buff *skb, struct genl_info *info)\n--\ndrivers/net/ovpn/netlink.c-1133-\tenum ovpn_key_slot slot;\ndrivers/net/ovpn/netlink.c:1134:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/netlink.c-1135-\tu32 peer_id;\n--\ndrivers/net/ovpn/netlink.c-1177- */\ndrivers/net/ovpn/netlink.c:1178:int ovpn_nl_peer_del_notify(struct ovpn_peer *peer)\ndrivers/net/ovpn/netlink.c-1179-{\n--\ndrivers/net/ovpn/netlink.c-1244- */\ndrivers/net/ovpn/netlink.c:1245:int ovpn_nl_peer_float_notify(struct ovpn_peer *peer,\ndrivers/net/ovpn/netlink.c-1246-\t\t\t const struct sockaddr_storage *ss)\n--\ndrivers/net/ovpn/netlink.c-1326- */\ndrivers/net/ovpn/netlink.c:1327:int ovpn_nl_key_swap_notify(struct ovpn_peer *peer, u8 key_id)\ndrivers/net/ovpn/netlink.c-1328-{\n--\ndrivers/net/ovpn/netlink.h=13=void ovpn_nl_unregister(void);\ndrivers/net/ovpn/netlink.h-14-\ndrivers/net/ovpn/netlink.h:15:int ovpn_nl_peer_del_notify(struct ovpn_peer *peer);\ndrivers/net/ovpn/netlink.h:16:int ovpn_nl_peer_float_notify(struct ovpn_peer *peer,\ndrivers/net/ovpn/netlink.h-17-\t\t\t const struct sockaddr_storage *ss);\ndrivers/net/ovpn/netlink.h:18:int ovpn_nl_key_swap_notify(struct ovpn_peer *peer, u8 key_id);\ndrivers/net/ovpn/netlink.h-19-\n--\ndrivers/net/ovpn/peer.c=25=static void unlock_ovpn(struct ovpn_priv *ovpn,\n--\ndrivers/net/ovpn/peer.c-28-{\ndrivers/net/ovpn/peer.c:29:\tstruct ovpn_peer *peer, *next;\ndrivers/net/ovpn/peer.c-30-\n--\ndrivers/net/ovpn/peer.c-45- */\ndrivers/net/ovpn/peer.c:46:void ovpn_peer_keepalive_set(struct ovpn_peer *peer, u32 interval, u32 timeout)\ndrivers/net/ovpn/peer.c-47-{\n--\ndrivers/net/ovpn/peer.c=75=static void ovpn_peer_keepalive_send(struct work_struct *work)\ndrivers/net/ovpn/peer.c-76-{\ndrivers/net/ovpn/peer.c:77:\tstruct ovpn_peer *peer = container_of(work, struct ovpn_peer,\ndrivers/net/ovpn/peer.c-78-\t\t\t\t\t keepalive_work);\n--\ndrivers/net/ovpn/peer.c-92- */\ndrivers/net/ovpn/peer.c:93:struct ovpn_peer *ovpn_peer_new(struct ovpn_priv *ovpn, u32 id)\ndrivers/net/ovpn/peer.c-94-{\ndrivers/net/ovpn/peer.c:95:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/peer.c-96-\tint ret;\n--\ndrivers/net/ovpn/peer.c-142- */\ndrivers/net/ovpn/peer.c:143:int ovpn_peer_reset_sockaddr(struct ovpn_peer *peer,\ndrivers/net/ovpn/peer.c-144-\t\t\t const struct sockaddr_storage *ss,\n--\ndrivers/net/ovpn/peer.c-191-\ndrivers/net/ovpn/peer.c:192:static void __ovpn_peer_hash_transp_addr(struct ovpn_peer *peer,\ndrivers/net/ovpn/peer.c-193-\t\t\t\t\t const struct ovpn_bind *bind);\n--\ndrivers/net/ovpn/peer.c-199- */\ndrivers/net/ovpn/peer.c:200:void ovpn_peer_endpoints_update(struct ovpn_peer *peer, struct sk_buff *skb)\ndrivers/net/ovpn/peer.c-201-{\n--\ndrivers/net/ovpn/peer.c=343=static void ovpn_peer_release_rcu(struct rcu_head *head)\ndrivers/net/ovpn/peer.c-344-{\ndrivers/net/ovpn/peer.c:345:\tstruct ovpn_peer *peer = container_of(head, struct ovpn_peer, rcu);\ndrivers/net/ovpn/peer.c-346-\n--\ndrivers/net/ovpn/peer.c-357- */\ndrivers/net/ovpn/peer.c:358:static void ovpn_peer_release(struct ovpn_peer *peer)\ndrivers/net/ovpn/peer.c-359-{\n--\ndrivers/net/ovpn/peer.c=372=void ovpn_peer_release_kref(struct kref *kref)\ndrivers/net/ovpn/peer.c-373-{\ndrivers/net/ovpn/peer.c:374:\tstruct ovpn_peer *peer = container_of(kref, struct ovpn_peer, refcount);\ndrivers/net/ovpn/peer.c-375-\n--\ndrivers/net/ovpn/peer.c=432=static struct in6_addr ovpn_nexthop_from_skb6(struct sk_buff *skb)\n--\ndrivers/net/ovpn/peer.c-450- */\ndrivers/net/ovpn/peer.c:451:static struct ovpn_peer *ovpn_peer_get_by_vpn_addr4(struct ovpn_priv *ovpn,\ndrivers/net/ovpn/peer.c-452-\t\t\t\t\t\t __be32 addr)\n--\ndrivers/net/ovpn/peer.c-455-\tstruct hlist_nulls_node *ntmp;\ndrivers/net/ovpn/peer.c:456:\tstruct ovpn_peer *tmp;\ndrivers/net/ovpn/peer.c-457-\tunsigned int slot;\n--\ndrivers/net/ovpn/peer.c-485- */\ndrivers/net/ovpn/peer.c:486:static struct ovpn_peer *ovpn_peer_get_by_vpn_addr6(struct ovpn_priv *ovpn,\ndrivers/net/ovpn/peer.c-487-\t\t\t\t\t\t struct in6_addr *addr)\n--\ndrivers/net/ovpn/peer.c-490-\tstruct hlist_nulls_node *ntmp;\ndrivers/net/ovpn/peer.c:491:\tstruct ovpn_peer *tmp;\ndrivers/net/ovpn/peer.c-492-\tunsigned int slot;\n--\ndrivers/net/ovpn/peer.c-518- */\ndrivers/net/ovpn/peer.c:519:static bool ovpn_peer_transp_match(const struct ovpn_peer *peer,\ndrivers/net/ovpn/peer.c-520-\t\t\t\t const struct sockaddr_storage *ss)\n--\ndrivers/net/ovpn/peer.c-562- */\ndrivers/net/ovpn/peer.c:563:static struct ovpn_peer *\ndrivers/net/ovpn/peer.c-564-ovpn_peer_get_by_transp_addr_p2p(struct ovpn_priv *ovpn,\n--\ndrivers/net/ovpn/peer.c-566-{\ndrivers/net/ovpn/peer.c:567:\tstruct ovpn_peer *tmp, *peer = NULL;\ndrivers/net/ovpn/peer.c-568-\n--\ndrivers/net/ovpn/peer.c-585- */\ndrivers/net/ovpn/peer.c:586:struct ovpn_peer *ovpn_peer_get_by_transp_addr(struct ovpn_priv *ovpn,\ndrivers/net/ovpn/peer.c-587-\t\t\t\t\t struct sk_buff *skb)\ndrivers/net/ovpn/peer.c-588-{\ndrivers/net/ovpn/peer.c:589:\tstruct ovpn_peer *tmp, *peer = NULL;\ndrivers/net/ovpn/peer.c-590-\tstruct sockaddr_storage ss = { 0 };\n--\ndrivers/net/ovpn/peer.c-636- */\ndrivers/net/ovpn/peer.c:637:static struct ovpn_peer *ovpn_peer_get_by_id_p2p(struct ovpn_priv *ovpn,\ndrivers/net/ovpn/peer.c-638-\t\t\t\t\t\t u32 peer_id)\ndrivers/net/ovpn/peer.c-639-{\ndrivers/net/ovpn/peer.c:640:\tstruct ovpn_peer *tmp, *peer = NULL;\ndrivers/net/ovpn/peer.c-641-\n--\ndrivers/net/ovpn/peer.c-657- */\ndrivers/net/ovpn/peer.c:658:struct ovpn_peer *ovpn_peer_get_by_id(struct ovpn_priv *ovpn, u32 peer_id)\ndrivers/net/ovpn/peer.c-659-{\ndrivers/net/ovpn/peer.c:660:\tstruct ovpn_peer *tmp, *peer = NULL;\ndrivers/net/ovpn/peer.c-661-\tstruct hlist_head *head;\n--\ndrivers/net/ovpn/peer.c-684-\ndrivers/net/ovpn/peer.c:685:static void ovpn_peer_remove(struct ovpn_peer *peer,\ndrivers/net/ovpn/peer.c-686-\t\t\t enum ovpn_del_peer_reason reason,\n--\ndrivers/net/ovpn/peer.c-734- */\ndrivers/net/ovpn/peer.c:735:struct ovpn_peer *ovpn_peer_get_by_dst(struct ovpn_priv *ovpn,\ndrivers/net/ovpn/peer.c-736-\t\t\t\t struct sk_buff *skb)\ndrivers/net/ovpn/peer.c-737-{\ndrivers/net/ovpn/peer.c:738:\tstruct ovpn_peer *peer = NULL;\ndrivers/net/ovpn/peer.c-739-\tstruct in6_addr addr6;\n--\ndrivers/net/ovpn/peer.c=861=bool ovpn_peer_check_by_src(struct ovpn_priv *ovpn, struct sk_buff *skb,\ndrivers/net/ovpn/peer.c:862:\t\t\t struct ovpn_peer *peer)\ndrivers/net/ovpn/peer.c-863-{\n--\ndrivers/net/ovpn/peer.c-903- */\ndrivers/net/ovpn/peer.c:904:static void __ovpn_peer_hash_transp_addr(struct ovpn_peer *peer,\ndrivers/net/ovpn/peer.c-905-\t\t\t\t\t const struct ovpn_bind *bind)\n--\ndrivers/net/ovpn/peer.c-958-\ndrivers/net/ovpn/peer.c:959:void ovpn_peer_hash_transp_addr(struct ovpn_peer *peer)\ndrivers/net/ovpn/peer.c-960-{\n--\ndrivers/net/ovpn/peer.c-975-\ndrivers/net/ovpn/peer.c:976:void ovpn_peer_hash_vpn_ip(struct ovpn_peer *peer)\ndrivers/net/ovpn/peer.c-977-{\n--\ndrivers/net/ovpn/peer.c-1020- */\ndrivers/net/ovpn/peer.c:1021:static int ovpn_peer_add_mp(struct ovpn_priv *ovpn, struct ovpn_peer *peer)\ndrivers/net/ovpn/peer.c-1022-{\n--\ndrivers/net/ovpn/peer.c-1027-\tstruct ovpn_bind *bind;\ndrivers/net/ovpn/peer.c:1028:\tstruct ovpn_peer *tmp;\ndrivers/net/ovpn/peer.c-1029-\tsize_t salen;\n--\ndrivers/net/ovpn/peer.c-1087- */\ndrivers/net/ovpn/peer.c:1088:static int ovpn_peer_add_p2p(struct ovpn_priv *ovpn, struct ovpn_peer *peer)\ndrivers/net/ovpn/peer.c-1089-{\ndrivers/net/ovpn/peer.c-1090-\tLLIST_HEAD(release_list);\ndrivers/net/ovpn/peer.c:1091:\tstruct ovpn_peer *tmp;\ndrivers/net/ovpn/peer.c-1092-\n--\ndrivers/net/ovpn/peer.c-1119- */\ndrivers/net/ovpn/peer.c:1120:int ovpn_peer_add(struct ovpn_priv *ovpn, struct ovpn_peer *peer)\ndrivers/net/ovpn/peer.c-1121-{\n--\ndrivers/net/ovpn/peer.c-1154- */\ndrivers/net/ovpn/peer.c:1155:static int ovpn_peer_del_mp(struct ovpn_peer *peer,\ndrivers/net/ovpn/peer.c-1156-\t\t\t enum ovpn_del_peer_reason reason,\n--\ndrivers/net/ovpn/peer.c-1158-{\ndrivers/net/ovpn/peer.c:1159:\tstruct ovpn_peer *tmp;\ndrivers/net/ovpn/peer.c-1160-\tint ret = -ENOENT;\n--\ndrivers/net/ovpn/peer.c-1183- */\ndrivers/net/ovpn/peer.c:1184:static int ovpn_peer_del_p2p(struct ovpn_peer *peer,\ndrivers/net/ovpn/peer.c-1185-\t\t\t enum ovpn_del_peer_reason reason,\n--\ndrivers/net/ovpn/peer.c-1187-{\ndrivers/net/ovpn/peer.c:1188:\tstruct ovpn_peer *tmp;\ndrivers/net/ovpn/peer.c-1189-\n--\ndrivers/net/ovpn/peer.c-1208- */\ndrivers/net/ovpn/peer.c:1209:int ovpn_peer_del(struct ovpn_peer *peer, enum ovpn_del_peer_reason reason)\ndrivers/net/ovpn/peer.c-1210-{\n--\ndrivers/net/ovpn/peer.c=1236=static void ovpn_peer_release_p2p(struct ovpn_priv *ovpn, struct sock *sk,\n--\ndrivers/net/ovpn/peer.c-1240-\tLLIST_HEAD(release_list);\ndrivers/net/ovpn/peer.c:1241:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/peer.c-1242-\n--\ndrivers/net/ovpn/peer.c=1263=static void ovpn_peers_release_mp(struct ovpn_priv *ovpn, struct sock *sk,\n--\ndrivers/net/ovpn/peer.c-1267-\tLLIST_HEAD(release_list);\ndrivers/net/ovpn/peer.c:1268:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/peer.c-1269-\tstruct hlist_node *tmp;\n--\ndrivers/net/ovpn/peer.c=1299=void ovpn_peers_free(struct ovpn_priv *ovpn, struct sock *sk,\n--\ndrivers/net/ovpn/peer.c-1311-\ndrivers/net/ovpn/peer.c:1312:static time64_t ovpn_peer_keepalive_work_single(struct ovpn_peer *peer,\ndrivers/net/ovpn/peer.c-1313-\t\t\t\t\t\ttime64_t now,\n--\ndrivers/net/ovpn/peer.c=1384=static time64_t ovpn_peer_keepalive_work_mp(struct ovpn_priv *ovpn,\n--\ndrivers/net/ovpn/peer.c-1389-\tstruct hlist_node *tmp;\ndrivers/net/ovpn/peer.c:1390:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/peer.c-1391-\tint bkt;\n--\ndrivers/net/ovpn/peer.c=1411=static time64_t ovpn_peer_keepalive_work_p2p(struct ovpn_priv *ovpn,\n--\ndrivers/net/ovpn/peer.c-1414-{\ndrivers/net/ovpn/peer.c:1415:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/peer.c-1416-\ttime64_t next_run = 0;\n--\ndrivers/net/ovpn/peer.h=64=struct ovpn_peer {\n--\ndrivers/net/ovpn/peer.h-124- */\ndrivers/net/ovpn/peer.h:125:static inline bool ovpn_peer_hold(struct ovpn_peer *peer)\ndrivers/net/ovpn/peer.h-126-{\n--\ndrivers/net/ovpn/peer.h=130=void ovpn_peer_release_kref(struct kref *kref);\n--\ndrivers/net/ovpn/peer.h-135- */\ndrivers/net/ovpn/peer.h:136:static inline void ovpn_peer_put(struct ovpn_peer *peer)\ndrivers/net/ovpn/peer.h-137-{\n--\ndrivers/net/ovpn/peer.h-140-\ndrivers/net/ovpn/peer.h:141:struct ovpn_peer *ovpn_peer_new(struct ovpn_priv *ovpn, u32 id);\ndrivers/net/ovpn/peer.h:142:int ovpn_peer_add(struct ovpn_priv *ovpn, struct ovpn_peer *peer);\ndrivers/net/ovpn/peer.h:143:int ovpn_peer_del(struct ovpn_peer *peer, enum ovpn_del_peer_reason reason);\ndrivers/net/ovpn/peer.h-144-void ovpn_peers_free(struct ovpn_priv *ovpn, struct sock *sock,\n--\ndrivers/net/ovpn/peer.h-146-\ndrivers/net/ovpn/peer.h:147:struct ovpn_peer *ovpn_peer_get_by_transp_addr(struct ovpn_priv *ovpn,\ndrivers/net/ovpn/peer.h-148-\t\t\t\t\t struct sk_buff *skb);\ndrivers/net/ovpn/peer.h:149:struct ovpn_peer *ovpn_peer_get_by_id(struct ovpn_priv *ovpn, u32 peer_id);\ndrivers/net/ovpn/peer.h:150:struct ovpn_peer *ovpn_peer_get_by_dst(struct ovpn_priv *ovpn,\ndrivers/net/ovpn/peer.h-151-\t\t\t\t struct sk_buff *skb);\ndrivers/net/ovpn/peer.h:152:void ovpn_peer_hash_vpn_ip(struct ovpn_peer *peer);\ndrivers/net/ovpn/peer.h:153:void ovpn_peer_hash_transp_addr(struct ovpn_peer *peer);\ndrivers/net/ovpn/peer.h-154-bool ovpn_peer_check_by_src(struct ovpn_priv *ovpn, struct sk_buff *skb,\ndrivers/net/ovpn/peer.h:155:\t\t\t struct ovpn_peer *peer);\ndrivers/net/ovpn/peer.h-156-\ndrivers/net/ovpn/peer.h:157:void ovpn_peer_keepalive_set(struct ovpn_peer *peer, u32 interval, u32 timeout);\ndrivers/net/ovpn/peer.h-158-void ovpn_peer_keepalive_work(struct work_struct *work);\ndrivers/net/ovpn/peer.h-159-\ndrivers/net/ovpn/peer.h:160:void ovpn_peer_endpoints_update(struct ovpn_peer *peer, struct sk_buff *skb);\ndrivers/net/ovpn/peer.h:161:int ovpn_peer_reset_sockaddr(struct ovpn_peer *peer,\ndrivers/net/ovpn/peer.h-162-\t\t\t const struct sockaddr_storage *ss,\n--\ndrivers/net/ovpn/skb.h=30=struct ovpn_cb {\ndrivers/net/ovpn/skb.h:31:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/skb.h-32-\tstruct ovpn_crypto_key_slot *ks;\n--\ndrivers/net/ovpn/socket.c=22=static void ovpn_socket_release_kref(struct kref *kref)\n--\ndrivers/net/ovpn/socket.c-42- */\ndrivers/net/ovpn/socket.c:43:static bool ovpn_socket_put(struct ovpn_peer *peer, struct ovpn_socket *sock)\ndrivers/net/ovpn/socket.c-44-{\n--\ndrivers/net/ovpn/socket.c-65- */\ndrivers/net/ovpn/socket.c:66:void ovpn_socket_release(struct ovpn_peer *peer)\ndrivers/net/ovpn/socket.c-67-{\n--\ndrivers/net/ovpn/socket.c=115=static int ovpn_socket_attach(struct ovpn_socket *ovpn_sock,\ndrivers/net/ovpn/socket.c-116-\t\t\t struct socket *sock,\ndrivers/net/ovpn/socket.c:117:\t\t\t struct ovpn_peer *peer)\ndrivers/net/ovpn/socket.c-118-{\n--\ndrivers/net/ovpn/socket.c-133- */\ndrivers/net/ovpn/socket.c:134:struct ovpn_socket *ovpn_socket_new(struct socket *sock, struct ovpn_peer *peer)\ndrivers/net/ovpn/socket.c-135-{\n--\ndrivers/net/ovpn/socket.h=29=struct ovpn_socket {\n--\ndrivers/net/ovpn/socket.h-34-\t\t};\ndrivers/net/ovpn/socket.h:35:\t\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/socket.h-36-\t};\n--\ndrivers/net/ovpn/socket.h=43=struct ovpn_socket *ovpn_socket_new(struct socket *sock,\ndrivers/net/ovpn/socket.h:44:\t\t\t\t struct ovpn_peer *peer);\ndrivers/net/ovpn/socket.h:45:void ovpn_socket_release(struct ovpn_peer *peer);\ndrivers/net/ovpn/socket.h-46-\n--\ndrivers/net/ovpn/tcp.c=36=static int ovpn_tcp_parse(struct strparser *strp, struct sk_buff *skb)\n--\ndrivers/net/ovpn/tcp.c-63-/* queue skb for sending to userspace via recvmsg on the socket */\ndrivers/net/ovpn/tcp.c:64:static void ovpn_tcp_to_userspace(struct ovpn_peer *peer, struct sock *sk,\ndrivers/net/ovpn/tcp.c-65-\t\t\t\t struct sk_buff *skb)\n--\ndrivers/net/ovpn/tcp.c-72-\ndrivers/net/ovpn/tcp.c:73:static struct sk_buff *ovpn_tcp_skb_packet(const struct ovpn_peer *peer,\ndrivers/net/ovpn/tcp.c-74-\t\t\t\t\t struct sk_buff *orig_skb,\n--\ndrivers/net/ovpn/tcp.c=102=static void ovpn_tcp_rcv(struct strparser *strp, struct sk_buff *skb)\ndrivers/net/ovpn/tcp.c-103-{\ndrivers/net/ovpn/tcp.c:104:\tstruct ovpn_peer *peer = container_of(strp, struct ovpn_peer, tcp.strp);\ndrivers/net/ovpn/tcp.c-105-\tstruct strp_msg *msg = strp_msg(skb);\n--\ndrivers/net/ovpn/tcp.c=161=static int ovpn_tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,\n--\ndrivers/net/ovpn/tcp.c-165-\tstruct ovpn_socket *sock;\ndrivers/net/ovpn/tcp.c:166:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/tcp.c-167-\tstruct sk_buff *skb;\n--\ndrivers/net/ovpn/tcp.c=210=void ovpn_tcp_socket_detach(struct ovpn_socket *ovpn_sock)\ndrivers/net/ovpn/tcp.c-211-{\ndrivers/net/ovpn/tcp.c:212:\tstruct ovpn_peer *peer = ovpn_sock-\u003epeer;\ndrivers/net/ovpn/tcp.c-213-\tstruct sock *sk = ovpn_sock-\u003esk;\n--\ndrivers/net/ovpn/tcp.c=239=void ovpn_tcp_socket_wait_finish(struct ovpn_socket *sock)\ndrivers/net/ovpn/tcp.c-240-{\ndrivers/net/ovpn/tcp.c:241:\tstruct ovpn_peer *peer = sock-\u003epeer;\ndrivers/net/ovpn/tcp.c-242-\n--\ndrivers/net/ovpn/tcp.c-255-\ndrivers/net/ovpn/tcp.c:256:static void ovpn_tcp_send_sock(struct ovpn_peer *peer, struct sock *sk)\ndrivers/net/ovpn/tcp.c-257-{\n--\ndrivers/net/ovpn/tcp.c=316=void ovpn_tcp_tx_work(struct work_struct *work)\n--\ndrivers/net/ovpn/tcp.c-327-\ndrivers/net/ovpn/tcp.c:328:static void ovpn_tcp_send_sock_skb(struct ovpn_peer *peer, struct sock *sk,\ndrivers/net/ovpn/tcp.c-329-\t\t\t\t struct sk_buff *skb)\n--\ndrivers/net/ovpn/tcp.c-345-\ndrivers/net/ovpn/tcp.c:346:void ovpn_tcp_send_skb(struct ovpn_peer *peer, struct sock *sk,\ndrivers/net/ovpn/tcp.c-347-\t\t struct sk_buff *skb)\n--\ndrivers/net/ovpn/tcp.c=369=static void ovpn_tcp_release(struct sock *sk)\n--\ndrivers/net/ovpn/tcp.c-372-\tstruct ovpn_socket *sock;\ndrivers/net/ovpn/tcp.c:373:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/tcp.c-374-\tstruct sk_buff *skb;\n--\ndrivers/net/ovpn/tcp.c=404=static int ovpn_tcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)\n--\ndrivers/net/ovpn/tcp.c-407-\tint ret, linear = PAGE_SIZE;\ndrivers/net/ovpn/tcp.c:408:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/tcp.c-409-\tstruct sk_buff *skb;\n--\ndrivers/net/ovpn/tcp.c=500=static void ovpn_tcp_peer_del_work(struct work_struct *work)\ndrivers/net/ovpn/tcp.c-501-{\ndrivers/net/ovpn/tcp.c:502:\tstruct ovpn_peer *peer = container_of(work, struct ovpn_peer,\ndrivers/net/ovpn/tcp.c-503-\t\t\t\t\t tcp.defer_del_work);\n--\ndrivers/net/ovpn/tcp.c=510=int ovpn_tcp_socket_attach(struct ovpn_socket *ovpn_sock,\ndrivers/net/ovpn/tcp.c:511:\t\t\t struct ovpn_peer *peer)\ndrivers/net/ovpn/tcp.c-512-{\n--\ndrivers/net/ovpn/tcp.c=578=static void ovpn_tcp_close(struct sock *sk, long timeout)\n--\ndrivers/net/ovpn/tcp.c-580-\tstruct ovpn_socket *sock;\ndrivers/net/ovpn/tcp.c:581:\tstruct ovpn_peer *peer;\ndrivers/net/ovpn/tcp.c-582-\n--\ndrivers/net/ovpn/tcp.c=602=static __poll_t ovpn_tcp_poll(struct file *file, struct socket *sock,\n--\ndrivers/net/ovpn/tcp.c-606-\tstruct ovpn_socket *ovpn_sock;\ndrivers/net/ovpn/tcp.c:607:\tstruct ovpn_peer *peer = NULL;\ndrivers/net/ovpn/tcp.c-608-\t__poll_t mask;\n\n"
} |
| 69/3 | 2026/09/24 08:02 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 39662 output: 37 thoughts: 26 Thoughts: Okay, let's dive into this. Here's my take on examining `ovpn_peer_new` in `drivers/net/ovpn/peer.c`: **Dissecting `ovpn_peer_new`** Right, so I need to understand how OpenVPN peers are instantiated within the kernel driver. Let's start by digging into `ovpn_peer_new` within the `drivers/net/ovpn/peer.c` file. This is the constructor, the function that's responsible for bringing a new peer object into existence. It likely handles memory allocation, initialization of data structures associated with the peer, and potentially the setup of some initial networking configurations. I'll expect to see allocations for the `ovpn_peer` structure itself, alongside any associated buffers for keying material, state information, and the like. It's also possible this function calls further helper functions to configure specific aspects of the peer, such as setting up cryptographic context or initializing the receive and transmit queues. Understanding the exact initialization sequence and the data elements initialized at that point in time is the key to grasping the overall architecture. I anticipate that I'll need to explore the underlying functions called, to track the data flow and how the peer is represented within the kernel network stack. Ultimately, the goal is to have a clear mental model of how a new OpenVPN peer is born and its resources are managed. Let's see what's what. |
| 70/3 | 2026/09/24 08:02 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/peer.c",
"FirstLine": 90,
"LineCount": 45
}Results: {
"Contents": " 90:\t *\n 91:\t * Return: a pointer to the new peer on success or an error code otherwise\n 92:\t */\n 93:\tstruct ovpn_peer *ovpn_peer_new(struct ovpn_priv *ovpn, u32 id)\n 94:\t{\n 95:\t\tstruct ovpn_peer *peer;\n 96:\t\tint ret;\n 97:\t\n 98:\t\t/* alloc and init peer object */\n 99:\t\tpeer = kzalloc_obj(*peer);\n 100:\t\tif (!peer)\n 101:\t\t\treturn ERR_PTR(-ENOMEM);\n 102:\t\n 103:\t\t/* in the default case TX and RX IDs are the same.\n 104:\t\t * the user may set a different TX ID via netlink\n 105:\t\t */\n 106:\t\tpeer-\u003eid = id;\n 107:\t\tpeer-\u003etx_id = id;\n 108:\t\tpeer-\u003eovpn = ovpn;\n 109:\t\n 110:\t\tpeer-\u003evpn_addrs.ipv4.s_addr = htonl(INADDR_ANY);\n 111:\t\tpeer-\u003evpn_addrs.ipv6 = in6addr_any;\n 112:\t\n 113:\t\tRCU_INIT_POINTER(peer-\u003ebind, NULL);\n 114:\t\tovpn_crypto_state_init(\u0026peer-\u003ecrypto);\n 115:\t\tspin_lock_init(\u0026peer-\u003elock);\n 116:\t\tkref_init(\u0026peer-\u003erefcount);\n 117:\t\tovpn_peer_stats_init(\u0026peer-\u003evpn_stats);\n 118:\t\tovpn_peer_stats_init(\u0026peer-\u003elink_stats);\n 119:\t\tINIT_WORK(\u0026peer-\u003ekeepalive_work, ovpn_peer_keepalive_send);\n 120:\t\n 121:\t\tret = dst_cache_init(\u0026peer-\u003edst_cache, GFP_KERNEL);\n 122:\t\tif (ret \u003c 0) {\n 123:\t\t\tnetdev_err(ovpn-\u003edev,\n 124:\t\t\t\t \"cannot initialize dst cache for peer %u\\n\",\n 125:\t\t\t\t peer-\u003eid);\n 126:\t\t\tkfree(peer);\n 127:\t\t\treturn ERR_PTR(ret);\n 128:\t\t}\n 129:\t\n 130:\t\tnetdev_hold(ovpn-\u003edev, \u0026peer-\u003edev_tracker, GFP_KERNEL);\n 131:\t\n 132:\t\treturn peer;\n 133:\t}\n 134:\t\n"
} |
| 71/3 | 2026/09/24 08:02 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 40708 output: 33 thoughts: 48 Thoughts: Okay, here's my summary, taking the role of the expert: **Investigating Memory Allocation in this Context** Alright, so `peer` has been allocated, likely using `kzalloc_obj(*peer)`. A pretty standard approach, I'd say, good for clearing the memory and potentially aligning it as well. Now, what about the related `bind` structure? It's always a good idea to understand how the associated structures are being allocated and deallocated as well. I need to understand what the allocation strategy is for the `struct ovpn_bind`. Time to go searching the code for every occurrence of `ovpn_bind` allocation. Need to understand the lifetime management of that object to fully get the big picture. |
| 72/3 | 2026/09/24 08:02 | tool | grepper |
0mError:no matches Args: {
"Expression": "kzalloc.*ovpn_bind",
"PathPrefix": "drivers/net/ovpn"
}Results: {
"error": "no matches"
} |
| 73/3 | 2026/09/24 08:02 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 40958 output: 37 thoughts: 29 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience: **Investigating `ovpn_bind_from_sockaddr`** Alright, let's dive into the core of this. I'm going to track down the function `ovpn_bind_from_sockaddr`. Given that we're talking about OpenVPN and binding to a socket, the likely place to find this is within the `drivers/net/ovpn/bind.c` source file. It's the most logical starting point for investigating how OpenVPN manages its socket bindings, especially if we're dealing with specific address configurations. I'm assuming this function is responsible for taking a `sockaddr` structure (likely a generic address representation) and using it to bind the OpenVPN socket. This might involve tasks like address validation, port selection, and error handling. I'll need to look at how it interacts with the underlying network stack, potential synchronization issues if it's multi-threaded, and any security considerations related to the bind operation. Time to see what we've got in that file. |
| 74/3 | 2026/09/24 08:02 | tool | read-file |
0mArgs:{
"File": "drivers/net/ovpn/bind.c",
"FirstLine": 15,
"LineCount": 45
}Results: {
"Contents": " 15:\t#include \"peer.h\"\n 16:\t\n 17:\t/**\n 18:\t * ovpn_bind_from_sockaddr - retrieve binding matching sockaddr\n 19:\t * @ss: the sockaddr to match\n 20:\t *\n 21:\t * Return: the new bind for the passed sockaddr, an ERR_PTR() on failure\n 22:\t */\n 23:\tstruct ovpn_bind *ovpn_bind_from_sockaddr(const struct sockaddr_storage *ss)\n 24:\t{\n 25:\t\tstruct ovpn_bind *bind;\n 26:\t\tsize_t sa_len;\n 27:\t\n 28:\t\tif (ss-\u003ess_family == AF_INET)\n 29:\t\t\tsa_len = sizeof(struct sockaddr_in);\n 30:\t\telse if (ss-\u003ess_family == AF_INET6)\n 31:\t\t\tsa_len = sizeof(struct sockaddr_in6);\n 32:\t\telse\n 33:\t\t\treturn ERR_PTR(-EAFNOSUPPORT);\n 34:\t\n 35:\t\tbind = kzalloc_obj(*bind, GFP_ATOMIC);\n 36:\t\tif (unlikely(!bind))\n 37:\t\t\treturn ERR_PTR(-ENOMEM);\n 38:\t\n 39:\t\tmemcpy(\u0026bind-\u003eremote, ss, sa_len);\n 40:\t\n 41:\t\treturn bind;\n 42:\t}\n 43:\t\n 44:\t/**\n 45:\t * ovpn_bind_reset - assign new binding to peer\n 46:\t * @peer: the peer whose binding has to be replaced\n 47:\t * @new: the new bind to assign\n 48:\t */\n 49:\tvoid ovpn_bind_reset(struct ovpn_peer *peer, struct ovpn_bind *new)\n 50:\t{\n 51:\t\tlockdep_assert_held(\u0026peer-\u003elock);\n 52:\t\n 53:\t\tkfree_rcu(rcu_replace_pointer(peer-\u003ebind, new,\n 54:\t\t\t\t\t lockdep_is_held(\u0026peer-\u003elock)), rcu);\n 55:\t}\n"
} |
| 75/3 | 2026/09/24 08:02 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 41820 output: 299 thoughts: 1490 Thoughts: **KMSAN Assessment: No Uninitialized Memory Risks Detected** Alright, let's break this down. My initial scan focused on potential uninitialized memory exposures, specifically related to the `bind` and `ovpn_peer` structs and the netlink attributes they contain, especially since we have some refactoring going on with `ovpn_nl_fill_peer`. First, I confirmed that `bind` is consistently allocated with `kzalloc_obj`, which is critical. This ensures all fields start zeroed. The individual fields are then populated via netlink attributes, which is done in `ovpn_nl_fill_peer`. The fields being put over netlink are standard types (`u32`, `u16`, and `struct in6_addr`), which are safe. `in6_addr` is known to be either explicitly zeroed or populated, so that's covered. The crucial point is that `ovpn_nl_fill_peer` is now shared between multiple netlink functions (peer get, peer delete) but it doesn't change anything fundamentally. The code was already doing the same thing. The code refactoring from `ovpn_nl_send_peer` to `ovpn_nl_fill_peer` is basically code reuse, moving the netlink attribute population logic into a common function. The deletion path (`ovpn_nl_peer_del_notify`) now uses `ovpn_nl_fill_peer`. I checked to make sure that the `peer` fields are still properly initialized during deletion. `peer` is allocated using `kzalloc_obj`, which zeroes all fields. I then did a sweep of the remaining changes: some doc updates, a redundant check removal, and the selftests. Nothing there looks like it could introduce uninitialized memory exposure. So, to summarize, the patch does **not** introduce any uninitialized memory risks. We have: * No stack or heap buffers copied to userspace with uninitialized bytes. * No uninitialized struct fields, because all allocations are `kzalloc_obj` or initialized. * No conditional branching on uninitialized data. * No changes in length calculations or boundary checks that could leak uninitialized memory. This means that KMSAN is not required. There's no scenario here where KASAN, LOCKDEP, or standard bug detectors wouldn't catch a memory issue first. KMSAN is a heavy hammer for specific cases of uninitialized memory; we're well within the bounds of what KASAN handles easily. Therefore, `NeedsKMSAN` is definitively set to `false`. |
| 76/3 | 2026/09/24 08:03 | tool | set-results |
0mArgs:{
"KMSANReasoning": "The patch series refactors netlink peer attribute formatting by extracting ovpn_nl_fill_peer() from ovpn_nl_send_peer() and reusing it in ovpn_nl_peer_del_notify(). In addition, it removes redundant peer null-checks in ovpn_decrypt_post() and ovpn_encrypt_post(), removes an unused work_struct field from struct ovpn_socket, updates documentation in bind.c, and updates selftests.\n\nAll peer and socket data structures in ovpn are allocated via kzalloc_obj, ensuring all fields are zero-initialized upon creation. The netlink attributes added to peer deletion notifications use standard typed nla_put helpers (e.g., nla_put_u32, nla_put_in_addr, nla_put_in6_addr, nla_put_uint) without copying uninitialized memory or struct padding to userspace. No uninitialized stack or heap data is introduced, modified, or branched upon. Any potential bugs introduced by these changes (such as reference counting issues with ovpn_peer_put, NULL pointer dereferences, or netlink skb allocation failures) are covered by standard kernel debuggers, KASAN, and LOCKDEP. Therefore, dedicated KMSAN fuzzing is not warranted.",
"NeedsKMSAN": false
}Results: {
"KMSANReasoning": "The patch series refactors netlink peer attribute formatting by extracting ovpn_nl_fill_peer() from ovpn_nl_send_peer() and reusing it in ovpn_nl_peer_del_notify(). In addition, it removes redundant peer null-checks in ovpn_decrypt_post() and ovpn_encrypt_post(), removes an unused work_struct field from struct ovpn_socket, updates documentation in bind.c, and updates selftests.\n\nAll peer and socket data structures in ovpn are allocated via kzalloc_obj, ensuring all fields are zero-initialized upon creation. The netlink attributes added to peer deletion notifications use standard typed nla_put helpers (e.g., nla_put_u32, nla_put_in_addr, nla_put_in6_addr, nla_put_uint) without copying uninitialized memory or struct padding to userspace. No uninitialized stack or heap data is introduced, modified, or branched upon. Any potential bugs introduced by these changes (such as reference counting issues with ovpn_peer_put, NULL pointer dereferences, or netlink skb allocation failures) are covered by standard kernel debuggers, KASAN, and LOCKDEP. Therefore, dedicated KMSAN fuzzing is not warranted.",
"NeedsKMSAN": false
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|