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-next>] [day] [month] [year] [list]
Date:	Mon, 7 Jul 2008 22:56:46 +0200
From:	Lennert Buytenhek <buytenh@...tstofly.org>
To:	Patrick McHardy <kaber@...sh.net>
Cc:	Nicolas Pitre <nico@....org>,
	Dale Farnsworth <dale@...nsworth.org>,
	Ashish Karkare <akarkare@...vell.com>,
	Jesper Dangaard Brouer <jdb@...x.dk>, netdev@...r.kernel.org
Subject: [PATCH 1/2][RFC] vlan: use pskb_copy() when inserting a vlan tag by hand

When inserting a vlan tag into an skb by hand (in the case the
target network device hardware does not support inserting a vlan
tag by passing it in via the TX descriptor), making a copy of the
skb to be modified by calling skb_copy() is overkill, since
skb_copy() will needlessly linearize the skb, copying of all of
the fragmented data around, and checksumming the paket in software
even if the hardware is perfectly capable of doing that by itself.

For this case, pskb_copy() does exactly what is needed and no more,
so use that instead.

Signed-off-by: Lennert Buytenhek <buytenh@...vell.com>

Index: linux-2.6.26-rc9/net/8021q/vlan_dev.c
===================================================================
--- linux-2.6.26-rc9.orig/net/8021q/vlan_dev.c
+++ linux-2.6.26-rc9/net/8021q/vlan_dev.c
@@ -74,7 +74,7 @@ static inline struct sk_buff *vlan_check
 {
 	if (vlan_dev_info(skb->dev)->flags & VLAN_FLAG_REORDER_HDR) {
 		if (skb_shared(skb) || skb_cloned(skb)) {
-			struct sk_buff *nskb = skb_copy(skb, GFP_ATOMIC);
+			struct sk_buff *nskb = pskb_copy(skb, GFP_ATOMIC);
 			kfree_skb(skb);
 			skb = nskb;
 		}
--
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