Skip to contentSkip to conversation

: Fix missing offset adjustment in pskb_expand_head

SK_BUFF Applied Patrick McHardy 2 participants 2 messages Apr 8, 2007 – Apr 9, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

These patches fix two crashes I was getting with net-2.6.22 on 64 bit caused by missing skb header offset adjustments when changing the headroom length.

[SK_BUFF]: Fix missing offset adjustment in pskb_expand_head

Since we're increasing the headroom, the header offsets need to be increased by the same amount as well.

---
commit fb98b03719ad23840ca005edbba3c86ef1e3282c
tree 25821494e6032e487f3d197fa1392206b0004583
parent 5899a39783bd49bd6b926eaeafc16c7276620f63
author Patrick McHardy <[email protected]> Sun, 08 Apr 2007 03:17:49 +0200 committer Patrick McHardy <[email protected]> Sun, 08 Apr 2007 03:17:49 +0200

 net/core/skbuff.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/core/skbuff.c +2 -1
index e60864e..5c9ee94 100644
@@ -725,14 +725,15 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
 	skb->data    += off;
 #ifdef NET_SKBUFF_DATA_USES_OFFSET
 	skb->end      = size;
+	off           = nhead;
 #else
 	skb->end      = skb->head + size;
+#endif
 	/* {transport,network,mac}_header and tail are relative to skb->head */
 	skb->tail	      += off;
 	skb->transport_header += off;
 	skb->network_header   += off;
 	skb->mac_header	      += off;
-#endif
 	skb->cloned   = 0;
 	skb->nohdr    = 0;
 	atomic_set(&skb_shinfo(skb)->dataref, 1);
maintainer Applied
#1 lore raw

From: Patrick McHardy <[email protected]>
Date: Sun, 08 Apr 2007 03:47:39 +0200

Quoted 3 lines

These patches fix two crashes I was getting with net-2.6.22 on 64 bit caused by missing skb header offset adjustments when changing the headroom length.

Applied.