Article View: linux.kernel.netdev
Article #690Re: [PATCH net-next 6/7] ovpn: send peer object along with PEER_DEL_NTF
From: netdev-bot+sashiko
Date: Thu, 08 Oct 2026 13:32
Date: Thu, 08 Oct 2026 13:32
124 lines
9837 bytes
9837 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 0 · Low: 1
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] This patch makes ovpn_nl_peer_del_notify()
(drivers/net/ovpn/netlink.c:1289) call ovpn_nl_fill_peer(msg, NULL,…
- [Low] The updated ovpn selftest only checks that the new PEER_DEL_NTF
counters exist, not their values.
--
ovpn: send peer object along with PEER_DEL_NTF
This commit moves the PEER_GET attribute filling into a new helper,
ovpn_nl_fill_peer(), and calls it from ovpn_nl_peer_del_notify(). As a
result, PEER_DEL_NTF now carries the full peer object, including the
final traffic counters. The selftest fixtures are updated, and the jq
filter normalizes counters and endpoint attributes before comparing.
> diff --git a/drivers/net/ovpn/netlink.c b/drivers/net/ovpn/netlink.c
> index 5432bc2eb8e80..15b6d99474b99 100644
> --- a/drivers/net/ovpn/netlink.c
> +++ b/drivers/net/ovpn/netlink.c
[ ... ]
> @@ -1273,7 +1286,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;
[Severity: High]
Does this expose PEER_GET data to unprivileged listeners?
The notification is sent with genlmsg_multicast_netns() to
OVPN_NLGRP_PEERS. That group has no capability flag:
drivers/net/ovpn/netlink-gen.c:
static const struct genl_multicast_group ovpn_nl_mcgrps[] = {
[OVPN_NLGRP_PEERS] = { "peers", },
};
The generic netlink socket is created with NL_CFG_F_NONROOT_RECV. The
only permission check on join is in genl_bind():
net/netlink/genetlink.c:genl_bind() {
...
if ((grp->flags & GENL_MCAST_CAP_NET_ADMIN) &&
!ns_capable(net->user_ns, CAP_NET_ADMIN))
ret = -EPERM;
...
}
So any process in the socket's netns can join "peers". OVPN_CMD_PEER_GET
(do and dump) is marked GENL_ADMIN_PERM, but the same data now reaches
that group on every peer deletion. The data includes tx-id, VPN
IPv4/IPv6, remote and local address/port, keepalive settings and all
eight vpn/link rx/tx counters.
Before this change, PEER_DEL_NTF carried only ifindex, peer id and
del-reason.
Should the "peers" group be marked cap-net-admin in
Documentation/netlink/specs/ovpn.yaml, with netlink-gen.c regenerated so
it gets GENL_MCAST_CAP_NET_ADMIN? Another option would be to send the
extended payload on a separate privileged group.
>
> nla_nest_end(msg, attr);
> diff --git a/tools/testing/selftests/net/ovpn/common.sh b/tools/testing/selftests/net/ovpn/common.sh
> index e33b1fe265221..08bb36ba3c806 100644
> --- a/tools/testing/selftests/net/ovpn/common.sh
> +++ b/tools/testing/selftests/net/ovpn/common.sh
[ ... ]
> +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");
[Severity: Low]
This isn't a bug, but this filter only checks that the counters are
present, not their values.
ovpn_compare_ntfs() runs both the expected fixtures and the received
output through this filter before the diff. The fixtures hard-code
every counter to 0, so the test would still pass if the kernel sent
zero, stale or swapped counters.
ovpn_run_basic_traffic() in test.sh sends traffic to every peer before
deletion:
ping -qfc 100 -w 3 5.5.5.$((p + 1))
So the counters should always be non-zero at that point. Would a check
such as .[key] |= (. > 0) work here, with true in the fixtures? That
would catch counters that are reset or not filled in.
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261007133018.1451958-2-antonio%40openvpn.net
Technical Details
Message-ID:
<179146632270.434549.899167774520008786@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343014-linux-kernel-netdev=dewy.ruReferences:
<20261007133018.1451958-7-antonio@openvpn.net>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343014-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 6/7] ovpn: send peer object along with PEER_DEL_NTF Date: Thu, 08 Oct 2026 13:32:02 +0000 Organization: Usenet Network Message-ID: <179146632270.434549.899167774520008786@kernel.org> References: <20261007133018.1451958-7-antonio@openvpn.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="890880"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:pbgjtmq5M9z+9TzoNBCiwcQijA4= sha256:SUqXyZo2ygTT4w03UN4aCvJFfSp9bnycGP5RyuAoOAQ= sha1:AmG/Wd4CcXLh/Fw/t3hdJC7iNiA= sha256:sFSieNcmxmfVK20p7hZ3KU5TImhKNJHaJiQQhg7XRSo= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 4C79F10F404; Thu, 8 Oct 2026 16:36:28 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.641 X-Spam-Status: No, score=-3.641 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.241, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g_vOiGra2ZeD; Thu, 8 Oct 2026 16:36:24 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-343014-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id E17B810F3B3; Thu, 8 Oct 2026 16:36:20 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 9455928B9B; Thu, 8 Oct 2026 13:32:12 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 400C94AA028; Thu, 8 Oct 2026 13:32:05 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CYbcDZWC" X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA2724A5EC7 for <netdev@vger.kernel.org>; Thu, 8 Oct 2026 13:32:03 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791466325; cv=none; b=rl+QaM46IMn59Y0EGVZNXJl6I4Xy7sHpYhytIUkj0MVsk92P8oSfN0llu5az7TKSdDzSKngBudVdXWHZeUbvfTGo/Nw+GFMGNW0zzjEWAT5fdWKU/bsnxn8nq7AP2oE9DvJfTfI07E5Jc/2lep9W66bN2wx73FHssfkoncyo2Ps= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791466325; c=relaxed/simple; bh=aMGBOYnLziJBnBXFla1AxQz2fx68e3Q/L8iR+wQbwzE=; h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=uAbhaAKJ/NK94JrVYMTIsKaFeVR8kZwx8f7lpM2bmm/8vzMtRqoaZnvpj1Lz5Y4fM14pR2LXHEIVCukVtQDRR/luFsuO0cU6sueUK8Hrq06tMtvn2DlTa0w9wXNza04IhP6Y7KWSpTONZuyXm8VBVcXY0HzouquFL+2u2d/ljxo= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CYbcDZWC; arc=none smtp.client-ip=100.103.45.18 X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EEFC1F00898; Thu, 8 Oct 2026 13:32:03 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1791466323; bh=VzzuPkgG0JMnQXdM43Na441ljBk5hLmBaUoGNX+eXWk=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=CYbcDZWCKIMmiPhAw8UwmCJTIadq0hzUENGbbDc8Lo3WOfc9XjvIIN8dhHmXYeVNJ aWdzS2FVC3o5qi6UWvtfFRw7yT0CEd0yMeY+iiMIVpyMZQAbLVGt0ShCCZhfuc9I+J vJmoAgXsYSQJ4IGKC4pPUF4gHH4vPhiK9W/GSeRVfVAUusbMWy/q3P+h2S0g5nbZCi HDMJbeo/7Tp0cGI+7DI+0GvrfRIuqolMmOCROE/MJ6NnjbnAWqckNZMRx+J6sf1+Ox dXEiuzWGfoeHE5XO+9VtR8NPEIz+L7IHxX1aKYm056amY0ZxQfYOdnVzdZ/nczEe7u 8bwsb8BzCvDjw== X-Cc: netdev@vger.kernel.org, ralf@mandelbit.com, sd@queasysnail.net, kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com X-In-Reply-To: <20261007133018.1451958-7-antonio@openvpn.net> X-sashiko-severity: High X-Precedence: bulk X-Mailing-List: netdev@vger.kernel.org X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>