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] [thread-next>] [day] [month] [year] [list]
Message-ID: <aNaxfvNzp9zyWXEd@horms.kernel.org>
Date: Fri, 26 Sep 2025 16:30:06 +0100
From: Simon Horman <horms@...nel.org>
To: Daniel Zahka <daniel.zahka@...il.com>
Cc: Jakub Kicinski <kuba@...nel.org>, Andrew Lunn <andrew+netdev@...n.ch>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
	Shuah Khan <shuah@...nel.org>,
	Willem de Bruijn <willemb@...gle.com>,
	Breno Leitao <leitao@...ian.org>, Petr Machata <petrm@...dia.com>,
	Yuyang Huang <yuyanghuang@...gle.com>,
	Xiao Liang <shaw.leon@...il.com>,
	Carolina Jubran <cjubran@...dia.com>,
	Donald Hunter <donald.hunter@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 1/9] netdevsim: a basic test PSP implementation

On Wed, Sep 24, 2025 at 12:49:47PM -0700, Daniel Zahka wrote:
> From: Jakub Kicinski <kuba@...nel.org>
> 
> Provide a PSP implementation for netdevsim.
> 
> Use psp_dev_encapsulate() and psp_dev_rcv() to do actual encapsulation
> and decapsulation on skbs, but perform no encryption or decryption. In
> order to make encryption with a bad key result in a drop on the peer's
> rx side, we stash our psd's generation number in the first byte of each
> key before handing to the peer.
> 
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> Co-developed-by: Daniel Zahka <daniel.zahka@...il.com>
> Signed-off-by: Daniel Zahka <daniel.zahka@...il.com>

...

> diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c

...

> @@ -1039,12 +1060,29 @@ static int nsim_init_netdevsim(struct netdevsim *ns)
>  	if (IS_ENABLED(CONFIG_DEBUG_NET)) {
>  		ns->nb.notifier_call = netdev_debug_event;
>  		if (register_netdevice_notifier_dev_net(ns->netdev, &ns->nb,
> -							&ns->nn))
> +							&ns->nn)){
>  			ns->nb.notifier_call = NULL;
> +			goto err_unregister_netdev;

Hi Daniel, Jakub, all,

This will result in this function returning err.
But here err is set to 0, wheras it seems it
should be set to a negative error value.

Flagged by Smatch.

> +		}
>  	}
>  
> +	err = nsim_psp_init(ns);
> +	if (err)
> +		goto err_unregister_notifier;
> +
>  	return 0;
>  
> +err_unregister_notifier:
> +	if (ns->nb.notifier_call)
> +		unregister_netdevice_notifier_dev_net(ns->netdev, &ns->nb,
> +						      &ns->nn);
> +err_unregister_netdev:
> +	rtnl_lock();
> +	peer = rtnl_dereference(ns->peer);
> +	if (peer)
> +		RCU_INIT_POINTER(peer->peer, NULL);
> +	RCU_INIT_POINTER(ns->peer, NULL);
> +	unregister_netdevice(ns->netdev);
>  err_ipsec_teardown:
>  	nsim_ipsec_teardown(ns);
>  	nsim_macsec_teardown(ns);

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ