Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net: devmem: allow bind-rx from non-init user namespaces
@ 2026-06-01 19:24 Bobby Eshleman
  2026-06-01 19:24 ` [PATCH net-next 1/2] " Bobby Eshleman
  2026-06-01 19:24 ` [PATCH net-next 2/2] selftests: drv-net: add userns devmem RX test Bobby Eshleman
  0 siblings, 2 replies; 4+ messages in thread
From: Bobby Eshleman @ 2026-06-01 19:24 UTC (permalink / raw)
  To: Donald Hunter, Jakub Kicinski, David S. Miller, Eric Dumazet,
	Paolo Abeni, Simon Horman, Andrew Lunn, Shuah Khan
  Cc: netdev, linux-kernel, linux-kselftest, Stanislav Fomichev,
	Mina Almasry, Bobby Eshleman

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.

Signed-off-by: Bobby Eshleman <bobbyeshleman@meta.com>
---
Bobby Eshleman (2):
      net: devmem: allow bind-rx from non-init user namespaces
      selftests: drv-net: add userns devmem RX test

 Documentation/netlink/specs/netdev.yaml            |  2 +-
 net/core/netdev-genl-gen.c                         |  2 +-
 tools/testing/selftests/drivers/net/hw/Makefile    |  1 +
 tools/testing/selftests/drivers/net/hw/config      |  1 +
 .../selftests/drivers/net/hw/lib/py/__init__.py    |  4 +-
 .../selftests/drivers/net/hw/userns_devmem.py      | 48 +++++++++++++
 tools/testing/selftests/drivers/net/lib/py/env.py  |  8 ++-
 tools/testing/selftests/net/lib/py/__init__.py     |  4 +-
 tools/testing/selftests/net/lib/py/netns.py        | 79 ++++++++++++++++++++++
 tools/testing/selftests/net/lib/py/utils.py        |  7 +-
 10 files changed, 146 insertions(+), 10 deletions(-)
---
base-commit: 0906c117f81c2ae6e6dbfa82719f79c75e1c9325
change-id: 20260529-nl-prov-491a85c020b0

Best regards,
-- 
Bobby Eshleman <bobbyeshleman@meta.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-06-01 23:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-01 19:24 [PATCH net-next 0/2] net: devmem: allow bind-rx from non-init user namespaces Bobby Eshleman
2026-06-01 19:24 ` [PATCH net-next 1/2] " Bobby Eshleman
2026-06-01 19:24 ` [PATCH net-next 2/2] selftests: drv-net: add userns devmem RX test Bobby Eshleman
2026-06-01 23:36   ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox