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]
Date:	Wed, 02 Dec 2009 06:13:15 +0100
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Andy Gospodarek <andy@...yhouse.net>
CC:	netdev@...r.kernel.org, fubar@...ibm.com
Subject: Re: [PATCH net-next-2.6] bonding: allow arp_ip_targets to be on a
 separate vlan from bond device

Andy Gospodarek a écrit :
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 5d131c2..eeee269 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2439,8 +2439,8 @@ int netif_receive_skb(struct sk_buff *skb)
>  		skb->skb_iif = skb->dev->ifindex;
>  
>  	null_or_orig = NULL;
> -	orig_dev = skb->dev;
> -	if (orig_dev->master) {
> +	orig_dev = __dev_get_by_index(dev_net(skb->dev),skb->skb_iif);
> +	if (orig_dev->master && !(skb->dev->priv_flags & IFF_802_1Q_VLAN)) {
>  		if (skb_bond_should_drop(skb))
>  			null_or_orig = orig_dev; /* deliver only exact match */
>  		else


Please dont add a __dev_get_by_index() call in netif_receive_skb()

First, this is not safe against writers.

Second its very expensive on some setups.

Eventually, you could do something like :


Change prototypes of netif_receive_skb() to include the orig_dev in arguments.
Change vlan code to call __netif_receive_skb(skb, orig_dev)
instead of netif_received_skb(skb)

int __netif_receive_skb(struct sk_buff *skb, struct net_device *orig_dev)
{
...
	if (!skb->skb_iif) {
		skb->skb_iif = orig_dev->ifindex;
	} else {
		if (orig_dev->master &&  ...) 
	}

}

int netif_receive_skb(struct sk_buff *skb)
{
	return __netif_receive_skb(skb, skb->dev);
}

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ