[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bd16ced2-32b2-4f94-aedf-cfa8a955fa7e@blackwall.org>
Date: Thu, 16 Oct 2025 14:45:41 +0300
From: Nikolay Aleksandrov <razor@...ckwall.org>
To: Johannes Wiesböck
<johannes.wiesboeck@...ec.fraunhofer.de>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>, Kuniyuki Iwashima <kuniyu@...gle.com>,
Stanislav Fomichev <sdf@...ichev.me>, Xiao Liang <shaw.leon@...il.com>,
Vlad Yasevich <vyasevic@...hat.com>,
Jitendra Kalsaria <jitendra.kalsaria@...gic.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: gyroidos@...ec.fraunhofer.de, sw@...onwunderlich.de,
Michael Weiß <michael.weiss@...ec.fraunhofer.de>,
Harshal Gohel <hg@...onwunderlich.de>
Subject: Re: [PATCH net v2] rtnetlink: Allow deleting FDB entries in user
namespace
On 10/15/25 23:15, Johannes Wiesböck wrote:
> Creating FDB entries is possible from a non-initial user namespace when
> having CAP_NET_ADMIN, yet, when deleting FDB entries, processes receive
> an EPERM because the capability is always checked against the initial
> user namespace. This restricts the FDB management from unprivileged
> containers.
>
> Drop the netlink_capable check in rtnl_fdb_del as it was originally
> dropped in c5c351088ae7 and reintroduced in 1690be63a27b without
> intention.
>
> This patch was tested using a container on GyroidOS, where it was
> possible to delete FDB entries from an unprivileged user namespace and
> private network namespace.
>
> Fixes: 1690be63a27b ("bridge: Add vlan support to static neighbors")
> Reviewed-by: Michael Weiß <michael.weiss@...ec.fraunhofer.de>
> Tested-by: Harshal Gohel <hg@...onwunderlich.de>
> Signed-off-by: Johannes Wiesböck <johannes.wiesboeck@...ec.fraunhofer.de>
> ---
> v2:
> - completely drop the capability check in favor of changing to
> netlink_net_capable
> - describe intended behavior already possible for adding FDB entries
> v1: https://lore.kernel.org/all/20250923082153.60030-1-johannes.wiesboeck@aisec.fraunhofer.de/
> ---
> net/core/rtnetlink.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index 8040ff7c356e4..576d5ec3bb364 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -4715,9 +4715,6 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
> int err;
> u16 vid;
>
> - if (!netlink_capable(skb, CAP_NET_ADMIN))
> - return -EPERM;
> -
> if (!del_bulk) {
> err = nlmsg_parse_deprecated(nlh, sizeof(*ndm), tb, NDA_MAX,
> NULL, extack);
Reviewed-by: Nikolay Aleksandrov <razor@...ckwall.org>
Powered by blists - more mailing lists