* [PATCH]: fix potential use after free in destroy_conntrack
@ 2003-06-20 10:44 Patrick McHardy
2003-06-24 16:11 ` Harald Welte
0 siblings, 1 reply; 3+ messages in thread
From: Patrick McHardy @ 2003-06-20 10:44 UTC (permalink / raw)
To: harald.welte; +Cc: netfilter-devel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 251 bytes --]
Hi Harald,
i missed this in my last patch (remove ct->master double check),
the reference to the master conntrack should not be dropped
until the expectation has deleted itself from the list.
This makes the last patch obsolete.
Best regards,
Patrick
[-- Attachment #2: Type: TEXT/PLAIN, Size: 1074 bytes --]
===== net/ipv4/netfilter/ip_conntrack_core.c 1.21 vs edited =====
--- 1.21/net/ipv4/netfilter/ip_conntrack_core.c Fri Jun 20 05:37:56 2003
+++ edited/net/ipv4/netfilter/ip_conntrack_core.c Fri Jun 20 12:33:23 2003
@@ -313,9 +313,6 @@
IP_NF_ASSERT(atomic_read(&nfct->use) == 0);
IP_NF_ASSERT(!timer_pending(&ct->timeout));
- if (ct->master && master_ct(ct))
- ip_conntrack_put(master_ct(ct));
-
/* To make sure we don't get any weird locking issues here:
* destroy_conntrack() MUST NOT be called with a write lock
* to ip_conntrack_lock!!! -HW */
@@ -332,9 +329,12 @@
/* Delete our master expectation */
if (ct->master) {
- /* can't call __unexpect_related here,
- * since it would screw up expect_list */
- list_del(&ct->master->expected_list);
+ if (ct->master->expectant) {
+ /* can't call __unexpect_related here,
+ * since it would screw up expect_list */
+ list_del(&ct->master->expected_list);
+ ip_conntrack_put(ct->master->expectant);
+ }
kfree(ct->master);
}
WRITE_UNLOCK(&ip_conntrack_lock);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-06-24 16:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-20 10:44 [PATCH]: fix potential use after free in destroy_conntrack Patrick McHardy
2003-06-24 16:11 ` Harald Welte
2003-06-24 16:35 ` 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.