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: <Z9mcjX08ZmcKhqXu@krikkit>
Date: Tue, 18 Mar 2025 17:17:17 +0100
From: Sabrina Dubroca <sd@...asysnail.net>
To: Paolo Abeni <pabeni@...hat.com>
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>, Simon Horman <horms@...nel.org>
Subject: Re: [PATCH net-next] net: introduce per netns packet chains

The patch mostly looks ok to me, except:


2025-03-17, 17:37:42 +0100, Paolo Abeni wrote:
>  /**
> - * dev_nit_active - return true if any network interface taps are in use
> + * dev_nit_active_rcu - return true if any network interface taps are in use
> + *
> + * The caller must held the RCU lock

typo: s/held/hold/


>   *
>   * @dev: network device to check for the presence of taps
>   */
> -bool dev_nit_active(struct net_device *dev)
> +bool dev_nit_active_rcu(struct net_device *dev)
>  {
> -	return !list_empty(&net_hotdata.ptype_all) ||
> +	return !list_empty(&dev_net_rcu(dev)->ptype_all) ||
>  	       !list_empty(&dev->ptype_all);
>  }
> -EXPORT_SYMBOL_GPL(dev_nit_active);
> +EXPORT_SYMBOL_GPL(dev_nit_active_rcu);
>  
>  /*
>   *	Support routine. Sends outgoing frames to any network
> @@ -2481,11 +2497,10 @@ EXPORT_SYMBOL_GPL(dev_nit_active);
>  
>  void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
>  {
> -	struct list_head *ptype_list = &net_hotdata.ptype_all;
> +	struct list_head *ptype_list = &dev_net_rcu(dev)->ptype_all;
>  	struct packet_type *ptype, *pt_prev = NULL;
>  	struct sk_buff *skb2 = NULL;
>  
> -	rcu_read_lock();

I can't convince myself that all callers of dev_queue_xmit_nit are
under RCU, specifically coming from drivers/net/wan/hdlc_x25.c
(x25_data_transmit). Maybe keep this rcu_read_lock here?

-- 
Sabrina

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ