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: <1364584656.5113.55.camel@edumazet-glaptop>
Date:	Fri, 29 Mar 2013 12:17:36 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	David Miller <davem@...emloft.net>
Cc:	shmulik.ladkani@...il.com, greearb@...delatech.com,
	netdev@...r.kernel.org, rgohita@...il.com
Subject: Re: [PATCH] net: core: Remove redundant call to 'nf_reset' in
 'dev_forward_skb'

On Fri, 2013-03-29 at 15:11 -0400, David Miller wrote:
> From: Shmulik Ladkani <shmulik.ladkani@...il.com>
> Date: Thu, 28 Mar 2013 11:13:26 +0200
> 
> > 'nf_reset' is called just prior calling 'netif_rx'.
> > No need to call it twice.
> > 
> > Reported-by: Igor Michailov <rgohita@...il.com>
> > Signed-off-by: Shmulik Ladkani <shmulik.ladkani@...il.com>
> 
> I do not see this happening in the:
> 
> 	macvlan_start_xmit()
> 
> 		 --> macvlan_queue_xmit()
> 
> code path.
> 
> I'm not applying this patch.  There seems to be no real agreement
> that the caller of dev_forward_skb() takes care of the nf_reset().
> 
> And wouldn't it be better to consolidate the nf_reset() calls
> into one place instead of several, increasing the audit burdon.
> 

Hmm, I believe you misread this patch :

nf_reset() is called _twice_ in dev_forward_skb()

int dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
{
        if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) {
                if (skb_copy_ubufs(skb, GFP_ATOMIC)) {
                        atomic_long_inc(&dev->rx_dropped);
                        kfree_skb(skb);
                        return NET_RX_DROP;
                }
        }

        skb_orphan(skb);
<1>     nf_reset(skb);

        if (unlikely(!is_skb_forwardable(dev, skb))) {
                atomic_long_inc(&dev->rx_dropped);
                kfree_skb(skb);
                return NET_RX_DROP;
        }
        skb->skb_iif = 0;
        skb->dev = dev;
        skb_dst_drop(skb);
        skb->tstamp.tv64 = 0;
        skb->pkt_type = PACKET_HOST;
        skb->protocol = eth_type_trans(skb, dev);
        skb->mark = 0;
        secpath_reset(skb);
<2>     nf_reset(skb);
        return netif_rx(skb);
}


--
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