Re: [bug, netconsole, SLUB] BUG skbuff_head_cache: Poison overwritten

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Evgeniy Polyakov
Date: Friday, July 18, 2008 - 3:16 am

Hi Pekka.

On Fri, Jul 18, 2008 at 12:02:26PM +0300, Pekka Enberg (penberg@cs.helsinki.fi) wrote:

Does it also scream on double free event? Just to closer guilty
circles... 0x9c offset is somewhere at the very end of the skbuff
structure, likely skb->users.

Can you also check in some kind of this patch to catch freed skb freeing
for testing?

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 3666216..dda96bf 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -419,6 +419,14 @@ void kfree_skb(struct sk_buff *skb)
 {
 	if (unlikely(!skb))
 		return;
+
+	{
+		u8 *ptr = (u8 *)(&skb->users);
+
+		if (*ptr == POISON_FREE || *ptr == POISON_INUSE || *ptr == POISON_END)
+			BUG();
+	}
+
 	if (likely(atomic_read(&skb->users) == 1))
 		smp_rmb();
 	else if (likely(!atomic_dec_and_test(&skb->users)))

-- 
	Evgeniy Polyakov
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [bug, netconsole, SLUB] BUG skbuff_head_cache: Poison ..., Evgeniy Polyakov, (Thu Jul 17, 10:46 pm)
Re: [bug, netconsole, SLUB] BUG skbuff_head_cache: Poison ..., Evgeniy Polyakov, (Fri Jul 18, 3:16 am)
Re: [bug, netconsole, SLUB] BUG skbuff_head_cache: Poison ..., Christoph Lameter, (Fri Jul 18, 6:54 am)
Re: [bug, netconsole, SLUB] BUG skbuff_head_cache: Poison ..., Christoph Lameter, (Fri Jul 18, 6:55 am)
Re: [bug, netconsole, SLUB] BUG skbuff_head_cache: Poison ..., Christoph Lameter, (Fri Jul 18, 7:48 am)
Re: [bug, netconsole, SLUB] BUG skbuff_head_cache: Poison ..., Evgeniy Polyakov, (Fri Jul 18, 9:07 am)
Re: [bug] Attempt to release alive inet socket f6fac040, Ingo Molnar, (Fri Jul 18, 12:10 pm)
Re: [bug] Attempt to release alive inet socket f6fac040, Ingo Molnar, (Fri Jul 18, 12:55 pm)
Re: [bug, netconsole, SLUB] BUG skbuff_head_cache: Poison ..., Evgeniy Polyakov, (Mon Jul 21, 3:06 am)
Re: [bug, netconsole, SLUB] BUG skbuff_head_cache: Poison ..., Evgeniy Polyakov, (Mon Jul 21, 4:25 am)
Re: [bug, netconsole, SLUB] BUG skbuff_head_cache: Poison ..., Evgeniy Polyakov, (Mon Jul 21, 5:57 am)
Re: [bug, netconsole, SLUB] BUG skbuff_head_cache: Poison ..., Christoph Lameter, (Mon Jul 21, 9:19 am)
Re: [bug, netconsole, SLUB] BUG skbuff_head_cache: Poison ..., Christoph Lameter, (Mon Jul 21, 9:22 am)
Re: [bug, netconsole, SLUB] BUG skbuff_head_cache: Poison ..., Evgeniy Polyakov, (Mon Jul 21, 12:57 pm)
Re: [bug, netconsole, SLUB] BUG skbuff_head_cache: Poison ..., Evgeniy Polyakov, (Mon Jul 21, 2:24 pm)