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: <1400081730.7973.98.camel@edumazet-glaptop2.roam.corp.google.com>
Date:	Wed, 14 May 2014 08:35:30 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Jesper Dangaard Brouer <brouer@...hat.com>
Cc:	netdev@...r.kernel.org,
	Alexander Duyck <alexander.h.duyck@...el.com>,
	Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
	Daniel Borkmann <dborkman@...hat.com>,
	Florian Westphal <fw@...len.de>,
	"David S. Miller" <davem@...emloft.net>,
	Stephen Hemminger <shemminger@...tta.com>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Robert Olsson <robert@...julf.se>,
	Ben Greear <greearb@...delatech.com>,
	John Fastabend <john.r.fastabend@...el.com>, danieltt@....se,
	zhouzhouyi@...il.com
Subject: Re: [net-next PATCH 3/5] pktgen: avoid atomic_inc per packet in
 xmit loop

On Wed, 2014-05-14 at 17:13 +0200, Jesper Dangaard Brouer wrote:

> Ah I see, then pktgen gets stopped, I might leak a SKB.
> 
> 
> > If done properly, you probably can avoid the kfree_skb(pkt_dev->skb) in
> > pktgen_xmit(), and set initial skb->users to max(1, pkt_dev->clone_skb);
> 
> Just setting max(1, pkt_dev->clone_skb) killed my machine (and my
> netconsole didn't send the entire output before dying).

Well, of course, I did not provide a patch, only a hint ;)

If all skb->users is set to the _exact_ number of
kfree_skb()/consume_skb() done by the driver, then no kfree_skb() is
needed in pktgen.

The thing is : clone_skb == 0 means basically that you need to init
skb->users to the number of time you plan to send this packet.

This depends on pkt_dev->count - pkt_dev->sofar and other things
probably.

min(dev->clone_skb, pkt_dev->count - pkt_dev->sofar)

But don't 'try' that without making sure its the right thing !!!

Make sure to replace atomic_dec(&(pkt_dev->skb->users)) by kfree_skb()
in case of NETDEV_TX_LOCKED/NETDEV_TX_BUSY




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