]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests: drv-net: add userns devmem RX test
authorBobby Eshleman <bobbyeshleman@meta.com>
Wed, 3 Jun 2026 01:37:32 +0000 (18:37 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 6 Jun 2026 01:10:31 +0000 (18:10 -0700)
commit78c1930198fc63f2d4761848cbe148c5b2958b01
treebbf1a023974baf2eb96140b202903b6a8d781e21
parente302aa3d00fb1bcbc1137a42615b1c54ca51d785
selftests: drv-net: add userns devmem RX test

Add userns_devmem.py, which mirrors nk_devmem.py but places the netkit
guest in a netns whose owning user_ns is non-init. ncdevmem is ran there
via nsenter so the bind-rx call is issued with creds that hold
CAP_NET_ADMIN only in the child user_ns.

Without the preceding GENL_UNS_ADMIN_PERM patch the test fails at
bind-rx with EPERM, but with the patch the transfer completes and tests
pass.

Signed-off-by: Bobby Eshleman <bobbyeshleman@meta.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20260602-nl-prov-v2-2-ad721142c641@meta.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/drivers/net/hw/Makefile
tools/testing/selftests/drivers/net/hw/config
tools/testing/selftests/drivers/net/hw/lib/py/__init__.py
tools/testing/selftests/drivers/net/hw/userns_devmem.py [new file with mode: 0755]
tools/testing/selftests/drivers/net/lib/py/__init__.py
tools/testing/selftests/drivers/net/lib/py/env.py
tools/testing/selftests/net/lib/py/__init__.py
tools/testing/selftests/net/lib/py/netns.py
tools/testing/selftests/net/lib/py/utils.py