]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Merge branch 'net-devmem-allow-bind-rx-from-non-init-user-namespaces'
authorJakub Kicinski <kuba@kernel.org>
Sat, 6 Jun 2026 01:10:33 +0000 (18:10 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 6 Jun 2026 01:10:34 +0000 (18:10 -0700)
Bobby Eshleman says:

====================
net: devmem: allow bind-rx from non-init user namespaces

NETDEV_CMD_BIND_RX is GENL_ADMIN_PERM, which checks CAP_NET_ADMIN
against init_user_ns. With netkit and netns support for devmem, it is
now useful to let workloads holding CAP_NET_ADMIN only in their own
user_ns issue bind-rx for a netns owned by that user_ns.

The first patch switches the flag to GENL_UNS_ADMIN_PERM so the check
uses the target netns's owning user_ns. Init remains permitted.

The second patch just adds test cases. They are identical to
nk_devmem.py tests, but using a non-init userns.
====================

Link: https://patch.msgid.link/20260602-nl-prov-v2-0-ad721142c641@meta.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Trivial merge