Skip to content

Commit bf29555

Browse files
jwsbckkuba-moo
authored andcommitted
rtnetlink: Allow deleting FDB entries in user namespace
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 c5c3510 and reintroduced in 1690be6 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: 1690be6 ("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>
1 parent 1b0124a commit bf29555

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

net/core/rtnetlink.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4715,9 +4715,6 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
47154715
int err;
47164716
u16 vid;
47174717

4718-
if (!netlink_capable(skb, CAP_NET_ADMIN))
4719-
return -EPERM;
4720-
47214718
if (!del_bulk) {
47224719
err = nlmsg_parse_deprecated(nlh, sizeof(*ndm), tb, NDA_MAX,
47234720
NULL, extack);

0 commit comments

Comments
 (0)