All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: "David S. Miller" <davem@davemloft.net>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Kernel Netdev Mailing List <netdev@vger.kernel.org>
Subject: [SK_BUFF]: Fix missing offset adjustment in pskb_expand_head
Date: Sun, 08 Apr 2007 03:47:39 +0200	[thread overview]
Message-ID: <461849BB.4090805@trash.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 154 bytes --]

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.


[-- Attachment #2: 01.diff --]
[-- Type: text/plain, Size: 1259 bytes --]

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

Signed-off-by: Patrick McHardy <kaber@trash.net>

---
commit fb98b03719ad23840ca005edbba3c86ef1e3282c
tree 25821494e6032e487f3d197fa1392206b0004583
parent 5899a39783bd49bd6b926eaeafc16c7276620f63
author Patrick McHardy <kaber@trash.net> Sun, 08 Apr 2007 03:17:49 +0200
committer Patrick McHardy <kaber@trash.net> Sun, 08 Apr 2007 03:17:49 +0200

 net/core/skbuff.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index e60864e..5c9ee94 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -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);

             reply	other threads:[~2007-04-08  1:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-08  1:47 Patrick McHardy [this message]
2007-04-09 18:45 ` [SK_BUFF]: Fix missing offset adjustment in pskb_expand_head David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=461849BB.4090805@trash.net \
    --to=kaber@trash.net \
    --cc=acme@ghostprotocols.net \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.