summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJohannes Wiesböck <johannes.wiesboeck@aisec.fraunhofer.de>2025-10-15 22:15:43 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-29 13:59:59 +0100
commit509da3463fdfe040927f2270f767ca65821a9302 (patch)
tree25a135be11cbef58ef342d7d5086afaddef104d9 /net
parent4b7140925d9dc642a14d39087d163044c204065b (diff)
downloadlinux-509da3463fdfe040927f2270f767ca65821a9302.tar.gz
linux-509da3463fdfe040927f2270f767ca65821a9302.tar.bz2
linux-509da3463fdfe040927f2270f767ca65821a9302.zip
rtnetlink: Allow deleting FDB entries in user namespace
[ Upstream commit bf29555f5bdc017bac22ca66fcb6c9f46ec8788f ] 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@aisec.fraunhofer.de> Tested-by: Harshal Gohel <hg@simonwunderlich.de> Signed-off-by: Johannes Wiesböck <johannes.wiesboeck@aisec.fraunhofer.de> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org> Link: https://patch.msgid.link/20251015201548.319871-1-johannes.wiesboeck@aisec.fraunhofer.de Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/core/rtnetlink.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 3d3743ef4f69..342b92afd121 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -3836,9 +3836,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);