From: Andrew Morton <akpm@osdl.org>
To: "David S. Miller" <davem@redhat.com>
Cc: manfred@colorfullife.com, dsw@gelato.unsw.edu.au,
linux-kernel@vger.kernel.org
Subject: Re: [BUG] 2.6.3 Slab corruption: errors are triggered when memory exceeds 2.5GB (correction)
Date: Tue, 24 Feb 2004 23:22:05 -0800 [thread overview]
Message-ID: <20040224232205.4fe87448.akpm@osdl.org> (raw)
In-Reply-To: <20040224230318.19a0e6b9.davem@redhat.com>
"David S. Miller" <davem@redhat.com> wrote:
>
> On Wed, 25 Feb 2004 07:21:56 +0100
> Manfred Spraul <manfred@colorfullife.com> wrote:
>
> > 0x620 (1568) is behind the end of the actual eth frame. Who could modify
> > that?
>
> At the end of the SKB data area is where we keep struct skb_shared_info, something
> is messing with the SKB state after a free it appears.
>
> And since it's turning the debugging value 0x6b to 0x6a it must be the
> "atomic_t dataref;" that is being mucked with.
Ah-hah.
This should find it:
25-akpm/include/linux/skbuff.h | 1 +
25-akpm/net/core/dev.c | 1 +
25-akpm/net/core/skbuff.c | 6 ++++++
3 files changed, 8 insertions(+)
diff -puN include/linux/skbuff.h~dataref-debug include/linux/skbuff.h
--- 25/include/linux/skbuff.h~dataref-debug Tue Feb 24 23:18:56 2004
+++ 25-akpm/include/linux/skbuff.h Tue Feb 24 23:19:20 2004
@@ -140,6 +140,7 @@ struct skb_frag_struct {
*/
struct skb_shared_info {
atomic_t dataref;
+ int debug;
unsigned int nr_frags;
unsigned short tso_size;
unsigned short tso_segs;
diff -puN net/core/dev.c~dataref-debug net/core/dev.c
--- 25/net/core/dev.c~dataref-debug Tue Feb 24 23:18:56 2004
+++ 25-akpm/net/core/dev.c Tue Feb 24 23:19:34 2004
@@ -1272,6 +1272,7 @@ int __skb_linearize(struct sk_buff *skb,
/* Set up shinfo */
ninfo = (struct skb_shared_info*)(data + size);
atomic_set(&ninfo->dataref, 1);
+ ninfo->debug = 0;
ninfo->tso_size = skb_shinfo(skb)->tso_size;
ninfo->tso_segs = skb_shinfo(skb)->tso_segs;
ninfo->nr_frags = 0;
diff -puN net/core/skbuff.c~dataref-debug net/core/skbuff.c
--- 25/net/core/skbuff.c~dataref-debug Tue Feb 24 23:18:56 2004
+++ 25-akpm/net/core/skbuff.c Tue Feb 24 23:21:36 2004
@@ -148,6 +148,7 @@ struct sk_buff *alloc_skb(unsigned int s
skb->end = data + size;
atomic_set(&(skb_shinfo(skb)->dataref), 1);
+ skb_shinfo(skb)->debug = 0;
skb_shinfo(skb)->nr_frags = 0;
skb_shinfo(skb)->tso_size = 0;
skb_shinfo(skb)->tso_segs = 0;
@@ -184,6 +185,9 @@ static void skb_clone_fraglist(struct sk
void skb_release_data(struct sk_buff *skb)
{
+ if (!skb->cloned)
+ WARN_ON(skb_shinfo(skb)->debug != 0);
+
if (!skb->cloned ||
atomic_dec_and_test(&(skb_shinfo(skb)->dataref))) {
if (skb_shinfo(skb)->nr_frags) {
@@ -320,6 +324,7 @@ struct sk_buff *skb_clone(struct sk_buff
C(tail);
C(end);
+ WARN_ON(skb_shinfo(skb)->debug != 0);
atomic_inc(&(skb_shinfo(skb)->dataref));
skb->cloned = 1;
@@ -526,6 +531,7 @@ int pskb_expand_head(struct sk_buff *skb
skb->h.raw += off;
skb->nh.raw += off;
skb->cloned = 0;
+ skb_shinfo(skb)->debug = 0;
atomic_set(&skb_shinfo(skb)->dataref, 1);
return 0;
_
next prev parent reply other threads:[~2004-02-25 7:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-24 6:38 Manfred Spraul
2004-02-24 6:56 ` Andrew Morton
2004-02-24 8:45 ` Darren Williams
2004-02-24 17:40 ` Manfred Spraul
2004-02-25 0:58 ` Darren Williams
2004-02-25 1:05 ` Anton Blanchard
2004-02-25 6:21 ` Manfred Spraul
2004-02-25 7:03 ` David S. Miller
2004-02-25 7:22 ` Andrew Morton [this message]
2004-02-25 8:24 ` Darren Williams
2004-02-25 17:18 ` Manfred Spraul
2004-02-26 0:30 ` Darren Williams
2004-02-25 8:55 ` Darren Williams
2004-02-25 10:18 ` Peter Chubb
2004-02-25 6:17 ` Darren Williams
-- strict thread matches above, loose matches on Subject: below --
2004-02-24 0:22 [BUG] 2.6.3 Slab corruption: errors are triggered when memory exceeds 2GB Darren Williams
2004-02-24 1:14 ` [BUG] 2.6.3 Slab corruption: errors are triggered when memory exceeds 2.5GB (correction) Darren Williams
2004-02-26 1:09 ` Darren Williams
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=20040224232205.4fe87448.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=davem@redhat.com \
--cc=dsw@gelato.unsw.edu.au \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®