Skip to contentSkip to conversation

net: sched: fix act_ipt for LOG target

PATCH Applied Phil Sutter 3 participants 3 messages Mar 3, 2016 – Mar 7, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: sched: fix act_ipt for LOG target

From: Phil Sutter <[email protected]>

Before calling the destroy() or target() callbacks, the family parameter field has to be initialized. Otherwise at least the LOG target will refuse to work and upon removal oops the kernel.

Cc Jamal Hadi Salim <[email protected]>
---
 net/sched/act_ipt.c | 2 ++
 1 file changed, 2 insertions(+)
net/sched/act_ipt.c +2 -0
index 89c41a1f35894..350e134cffb32 100644
@@ -66,6 +66,7 @@ static void ipt_destroy_target(struct xt_entry_target *t)
 	struct xt_tgdtor_param par = {
 		.target   = t->u.kernel.target,
 		.targinfo = t->data,
+		.family   = NFPROTO_IPV4,
 	};
 	if (par.target->destroy != NULL)
 		par.target->destroy(&par);
@@ -219,6 +220,7 @@ static int tcf_ipt(struct sk_buff *skb, const struct tc_action *a,
 	par.hooknum  = ipt->tcfi_hook;
 	par.target   = ipt->tcfi_t->u.kernel.target;
 	par.targinfo = ipt->tcfi_t->data;
+	par.family   = NFPROTO_IPV4;
 	ret = par.target->target(skb, &par);
 
 	switch (ret) {
Signature · 1 line
2.7.2
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Phil Sutter

From: Phil Sutter <[email protected]>

Before calling the destroy() or target() callbacks, the family parameter field has to be initialized. Otherwise at least the LOG target will refuse to work and upon removal oops the kernel.

Cc Jamal Hadi Salim <[email protected]>

Caveat: ipt has not been receiving a lot of love. Thanks for showing it some love. If indeed you have tested this with the LOG target, then:

cheers,
jamal

maintainer Applied
#2 lore raw
In reply to Phil Sutter

From: Phil Sutter <[email protected]>
Date: Thu, 3 Mar 2016 14:34:14 +0100

Quoted 8 lines

From: Phil Sutter <[email protected]>

Before calling the destroy() or target() callbacks, the family parameter field has to be initialized. Otherwise at least the LOG target will refuse to work and upon removal oops the kernel.

Cc Jamal Hadi Salim <[email protected]>

Applied.