Fix ct_sync crash
Subsystems (2)
Hi,
the following two patches fix a bug in ct_sync.
Please apply, thanks!
/holger
GIT: Please enter your email below.
GIT: Lines beginning in "GIT: " will be removed.
GIT: Consider including an overall diffstat or table of contents
GIT: for the patch you are writing.
Hi,
the following two patches fix a bug in ct_sync.
Please apply, thanks!
/holger
Hi,
the following two patches fix a bug in ct_sync.
Please apply, thanks!
/holger
PATCH 1/1 Fix use of unitializied tuplehash list-head
ct_sync fails to initialize its tuplehash list-head upon creation of a new conntrack, so that an list_del() later on in destroy_conntrack() leads to a crash.
This patch initializes the list-head.
---
ct_sync/ct_sync_main.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
3bdbf56aa5e9e7411d8f32fa896f51ebd5a8ce15
ct_sync/ct_sync_main.c +2 -0
@@ -613,6 +613,8 @@ ct_sync_msg_process_update_ct(struct ct_CT_SYNC_LEAVE ();return -1 ; } + +INIT_LIST_HEAD (&ct->tuplehash[IP_CT_DIR_ORIGINAL ].list); new =1 ; }
Signature · 1 line
-dirty
PATCH 1/1 Remove BUG_ON() in destroy_conntrack()
Remove BUG_ON(list_empty(...)) check in destroy_conntrack because it is perfectly valid for conntracks to be in no list at all, e. g. if ct_sync is used.
---
net/ipv4/netfilter/ip_conntrack_core.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
8f62bac9822927ea1306d4752ca48cb1d9f73ff0
net/ipv4/netfilter/ip_conntrack_core.c +1 -3
@@ -339,10 +339,8 @@ destroy_conntrack(struct nf_conntrack *nip_ct_remove_expectations (ct);/* We overload first tuple to link into unconfirmed list. */ -if (!is_confirmed (ct)) { -BUG_ON (list_empty (&ct->tuplehash[IP_CT_DIR_ORIGINAL ].list)); +if (!is_confirmed (ct))list_del (&ct->tuplehash[IP_CT_DIR_ORIGINAL ].list); - }CONNTRACK_STAT_INC (delete);write_unlock_bh (&ip_conntrack_lock);
Signature · 1 line
-dirty
Re: [PATCH] [NETFILTER] Remove BUG_ON() in destroy_conntrack()
Quoted 3 lines · Holger Eitzenberger
Remove BUG_ON(list_empty(...)) check in
destroy_conntrackbecause it is perfectly valid for conntracks to be in no list at all, e. g. ifct_syncis used.
This should stay in the ct_sync patchset until it is merged.