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, 06 Feb 2013 17:30:32 +0800
From:	Cong Wang <amwang@...hat.com>
To:	David Laight <David.Laight@...LAB.COM>
Cc:	netdev@...r.kernel.org, Jesse Gross <jesse@...ira.com>,
	"David S. Miller" <davem@...emloft.net>
Subject: RE: [PATCH net-next v2] net: adjust skb_gso_segment() for calling
 in rx path

On Wed, 2013-02-06 at 09:23 +0000, David Laight wrote:
> > +/* openvswitch calls this on rx path, so we need a different check.
> > + */
> > +static inline bool skb_needs_check(struct sk_buff *skb, bool tx_path)
> > +{
> > +	if (tx_path)
> > +		return skb->ip_summed != CHECKSUM_PARTIAL;
> > +	else
> > +		return skb->ip_summed == CHECKSUM_NONE;
> > +}
> > +
> 
> That code wants a lot of unlikely() added.
> 
> It seems wrong to be adding code a very common path for one
> obscure caller.

Its caller does:

+       if (unlikely(skb_needs_check(skb, tx_path))) {

> 
> Perhaps the caller should be modifying the ip_summed field
> (etc) to match the values expected for a tx skb.
> 

This is even uglier, you need to restore ip_summed after calling
skb_gso_segment().


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