All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipt_do_table accesss pskb after it has been freed
@ 2003-11-07  2:18 Dirk Morris
  2003-11-07  8:57 ` Harald Welte
  0 siblings, 1 reply; 4+ messages in thread
From: Dirk Morris @ 2003-11-07  2:18 UTC (permalink / raw)
  To: dmorris, netfilter-devel

I had a target in the mangle/PREROUTING that was freeing the skb and 
returning NF_STOLEN.
ipt_do_table would then cause a kernel panic as it accesses the skb 
after its freed.

Is this a bug? If so, here's the patch.

-dirk

-->

diff -urN --ignore-all-space 
linux-2.6.0-test8-orig/net/ipv4/netfilter/ip_tables.c 
linux-2.6.0-test8-netcap2/net/ipv4/netfilter/ip_tables.c
--- linux-2.6.0-test8-orig/net/ipv4/netfilter/ip_tables.c       
2003-10-17 14:42:57.000000000 -0700
+++ linux-2.6.0-test8-netcap2/net/ipv4/netfilter/ip_tables.c    
2003-11-06 18:03:26.000000000 -0800
@@ -375,8 +375,10 @@
                                       = 0x57acc001;
#endif
                               /* Target might have changed stuff. */
+              if (verdict != NF_STOLEN) {
                               ip = (*pskb)->nh.iph;
                               datalen = (*pskb)->len - ip->ihl * 4;
+              }

                               if (verdict == IPT_CONTINUE)
                                       e = (void *)e + e->next_offset;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-11-07 18:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-07  2:18 [PATCH] ipt_do_table accesss pskb after it has been freed Dirk Morris
2003-11-07  8:57 ` Harald Welte
2003-11-07 16:09   ` dmorris
2003-11-07 18:18     ` Henrik Nordstrom

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.