lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aYzCBIACSmC0l+oA@devvm11784.nha0.facebook.com>
Date: Wed, 11 Feb 2026 09:53:08 -0800
From: Bobby Eshleman <bobbyeshleman@...il.com>
To: David Wei <dw@...idwei.uk>
Cc: netdev@...r.kernel.org, Andrew Lunn <andrew+netdev@...n.ch>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Joe Damato <joe@...a.to>, Wei Wang <weibunny@...a.com>,
	Stanislav Fomichev <sdf@...ichev.me>,
	Nikolay Aleksandrov <razor@...ckwall.org>
Subject: Re: [PATCH net-next 4/4] selftests/net: Add netkit container ping
 test

On Tue, Feb 10, 2026 at 12:04:19PM -0800, David Wei wrote:
> Add a basic ping test using NetDrvContEnv that sets up a netkit pair,
> with one end in a netns. Use LOCAL_PREFIX_V6 and nk_forward BPF program
> to ping from a remote host to the netkit in netns.
> 
> Signed-off-by: David Wei <dw@...idwei.uk>
> Signed-off-by: Daniel Borkmann <daniel@...earbox.net>
> ---
>  .../testing/selftests/drivers/net/hw/Makefile |  1 +
>  tools/testing/selftests/drivers/net/hw/config |  3 +++
>  .../selftests/drivers/net/hw/nk_netns.py      | 23 +++++++++++++++++++
>  3 files changed, 27 insertions(+)
>  create mode 100755 tools/testing/selftests/drivers/net/hw/nk_netns.py
> 
> diff --git a/tools/testing/selftests/drivers/net/hw/Makefile b/tools/testing/selftests/drivers/net/hw/Makefile
> index a64140333a46..91df028abfc0 100644
> --- a/tools/testing/selftests/drivers/net/hw/Makefile
> +++ b/tools/testing/selftests/drivers/net/hw/Makefile
> @@ -32,6 +32,7 @@ TEST_PROGS = \
>  	irq.py \
>  	loopback.sh \
>  	nic_timestamp.py \
> +	nk_netns.py \
>  	pp_alloc_fail.py \
>  	rss_api.py \
>  	rss_ctx.py \
> diff --git a/tools/testing/selftests/drivers/net/hw/config b/tools/testing/selftests/drivers/net/hw/config
> index 2307aa001be1..b6524040418e 100644
> --- a/tools/testing/selftests/drivers/net/hw/config
> +++ b/tools/testing/selftests/drivers/net/hw/config
> @@ -1,3 +1,4 @@
> +CONFIG_BPF_SYSCALL=y
>  CONFIG_FAIL_FUNCTION=y
>  CONFIG_FAULT_INJECTION=y
>  CONFIG_FAULT_INJECTION_DEBUG_FS=y
> @@ -5,6 +6,8 @@ CONFIG_FUNCTION_ERROR_INJECTION=y
>  CONFIG_IO_URING=y
>  CONFIG_IPV6=y
>  CONFIG_IPV6_GRE=y
> +CONFIG_NETKIT=y
> +CONFIG_NET_CLS_BPF=y
>  CONFIG_NET_IPGRE=y
>  CONFIG_NET_IPGRE_DEMUX=y
>  CONFIG_UDMABUF=y

I did find CONFIG_NET_SCH_INGRESS=y being needed for the qdisc too,
sorry for missing that last rev.

> diff --git a/tools/testing/selftests/drivers/net/hw/nk_netns.py b/tools/testing/selftests/drivers/net/hw/nk_netns.py
> new file mode 100755
> index 000000000000..afa8638195d8
> --- /dev/null
> +++ b/tools/testing/selftests/drivers/net/hw/nk_netns.py
> @@ -0,0 +1,23 @@
> +#!/usr/bin/env python3
> +# SPDX-License-Identifier: GPL-2.0
> +
> +from lib.py import ksft_run, ksft_exit
> +from lib.py import NetDrvContEnv
> +from lib.py import cmd
> +
> +
> +def test_ping(cfg) -> None:
> +    cfg.require_ipver("6")
> +
> +    cmd(f"ping -c 1 -W5 {cfg.nk_guest_ipv6}", host=cfg.remote)
> +    cmd(f"ping -c 1 -W5 {cfg.remote_addr_v['6']}", ns=cfg.netns)
> +
> +
> +def main() -> None:
> +    with NetDrvContEnv(__file__) as cfg:
> +        ksft_run([test_ping], args=(cfg,))
> +    ksft_exit()
> +
> +
> +if __name__ == "__main__":
> +    main()
> -- 
> 2.47.3
> 

I had some issues getting this to work until I enabled IPv6 forwarding.
I wasn't able to tell if this was only required because of my particular
REMOTE_TYPE=netns setup, or if it is something that is required by this
test specifically? 

I'm also running this directly, but maybe this is done prior in
kselftest?

Best,
Bobby

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ