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: <20090806.133518.263376332.davem@davemloft.net>
Date:	Thu, 06 Aug 2009 13:35:18 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	eric.dumazet@...il.com
Cc:	kaber@...sh.net, netdev@...r.kernel.org, markmc@...hat.com
Subject: Re: [PATCH V2 net-next-2.6] net: relax dst refcnt in input path

From: Eric Dumazet <eric.dumazet@...il.com>
Date: Wed, 22 Jul 2009 17:40:06 +0200

> [PATCH net-next-2.6] net: relax dst refcnt in input path


Two things:

1) Don't use a boolean name like "noref" it results in using
   double-negatives in one's mind while trying to read and understand
   the code.

   Call these arguments "need_ref" or something like that.

   Also, use "bool" type.

2) I wonder about this:

> @@ -1700,9 +1700,15 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
>  		 * If device doesnt need skb->dst, release it right now while
>  		 * its hot in this cpu cache
>  		 */
> -		if (dev->priv_flags & IFF_XMIT_DST_RELEASE)
> -			skb_dst_drop(skb);
> -
> +		if (skb_dst(skb)) {
> +			if (dev->priv_flags & IFF_XMIT_DST_RELEASE)
> +				skb_dst_drop(skb);
> +			else
> +				/*
> +				 * make sure dst was refcounted by caller
> +				 */
> +				WARN_ON(!(skb->_skb_dst & SKB_DST_REFTAKEN));
> +		}
>  		rc = ops->ndo_start_xmit(skb, dev);
>  		if (rc == NETDEV_TX_OK)

So, won't this warning trigger if we are forwarding to a device that
does not set IFF_XMIT_DST_RELEASE?

If I understand things correctly, in IPv4 when we're not delivering to
a socket, we don't take a reference.

We'll get here from the forwarding path with a DST, and the target TX
device has IFF_XMIT_DST_RELEASE clear, the WARN_ON above will trigger.
--
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