Skip to contentSkip to conversation

netfilter: ctnetlink: do not allow to reset helper on existing conntrack

PATCH New Pablo Neira Ayuso 1 participant 1 message Jun 22

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 netfilter: ctnetlink: do not allow to reset helper on existing conntrack

This feature allows to reset a helper for an existing conntrack, but it is not safe. This requires a synchronized_rcu() call after resetting the helper, which is going to be expensive for a large batch of conntrack entries. This also needs to call to the .destroy callback to release the GRE/PPTP mappings to fix it.

Given that I cannot find any user in the netfilter.org userspace tree, I prefer to remove this feature. This feature antedates the creation of the conntrack-tools.

Fixes c1d10adb4a52 ("[NETFILTER]: Add ctnetlink port for nf_conntrack")
---
 net/netfilter/nf_conntrack_netlink.c | 13 -------------
 1 file changed, 13 deletions(-)
net/netfilter/nf_conntrack_netlink.c +0 -13
index e4095fb4bb4c..4217715d42dc 100644
@@ -1953,19 +1953,6 @@ static int ctnetlink_change_helper(struct nf_conn *ct,
 		return err;
 	}
 
-	if (!strcmp(helpname, "") && help) {
-		helper = rcu_dereference(help->helper);
-		if (helper) {
-			/* we had a helper before ... */
-			nf_ct_remove_expectations(ct);
-			RCU_INIT_POINTER(help->helper, NULL);
-			if (refcount_dec_and_test(&helper->ct_refcnt))
-				kfree_rcu(helper, rcu);
-		}
-		rcu_read_unlock();
-		return 0;
-	}
-
 	helper = __nf_conntrack_helper_find(helpname, nf_ct_l3num(ct),
 					    nf_ct_protonum(ct));
 	if (helper == NULL) {
Signature · 1 line
2.47.3