All of lore.kernel.org
 help / color / mirror / Atom feed
* BUG: libiptc chain references bug
@ 2006-07-12 15:25 Jesper Dangaard Brouer
  2006-07-13 11:17 ` Jesper Dangaard Brouer
  0 siblings, 1 reply; 7+ messages in thread
From: Jesper Dangaard Brouer @ 2006-07-12 15:25 UTC (permalink / raw)
  To: netfilter-devel


I have found a chain reference bug in libiptc or iptables.c.

When deleting a rule, with iptables do_command("-D xxx -j yyy") that
calls "iptc_delete_entry" the reference count of the rules jump
target chain is not decremented.

When deleting the rule with iptables do_command("-D xxx rule_num")
that calls "iptc_delete_num_entry" the reference count is correctly
decremeted.

Notice, that the chain gets the correct reference count after a
"commit" of the handle.


  Here is the call sequence, of the bug:

+------
[Function] init() libiptc handle
[Function] create_chain(badehat)

[Function] iptables_do_command(-I FORWARD -j badehat)
[Function] get_references(badehat): refs=1

[Function] iptables_do_command(-D FORWARD -j badehat)
[Function] get_references(badehat): refs=1

[Function] commit()

System command: iptables -L badehat
Chain badehat (0 references)
target     prot opt source               destination
+------

  Here is the call sequence, where the bug does not occur:

+------
[Function] init() libiptc handle
[Function] create_chain(badehat)

[Function] iptables_do_command(-I FORWARD -j badehat)
[Function] get_references(badehat): refs=1

[Function] iptables_do_command(-D FORWARD 1)
[Function] get_references(badehat): refs=0

[Function] commit()

System command: iptables -L badehat
Chain badehat (0 references)
target     prot opt source               destination
+------


Hilsen
   Jesper Brouer

--
-------------------------------------------------------------------
MSc. Master of Computer Science
Dept. of Computer Science, University of Copenhagen
Author of http://www.adsl-optimizer.dk
-------------------------------------------------------------------

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

end of thread, other threads:[~2006-07-20 16:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-12 15:25 BUG: libiptc chain references bug Jesper Dangaard Brouer
2006-07-13 11:17 ` Jesper Dangaard Brouer
2006-07-14 12:29   ` [PATCH] " Jesper Dangaard Brouer
2006-07-16 15:01     ` Pablo Neira Ayuso
2006-07-16 20:19       ` Jesper Dangaard Brouer
2006-07-16 22:31         ` Pablo Neira Ayuso
2006-07-20 16:52         ` Patrick McHardy

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.