Skip to contentSkip to conversation

Patch "net: sched: set xt_tgchk_param par.nft_compat as 0 in ipt_init_target" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Aug 11, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

net: sched: set xt_tgchk_param par.nft_compat as 0 in ipt_init_target

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
net-sched-set-xt_tgchk_param-par.nft_compat-as-0-in-ipt_init_target.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Fri Aug 11 09:10:20 PDT 2017

From: Xin Long <[email protected]>
Date: Wed, 9 Aug 2017 18:15:19 +0800
Subject: net: sched: set xt_tgchk_param par.nft_compat as 0 in ipt_init_target

From: Xin Long <[email protected]>

[ Upstream commit 96d9703050a0036a3360ec98bb41e107c90664fe ]

Commit 55917a21d0cc ("netfilter: x_tables: add context to know if extension runs from nft_compat") introduced a member nft_compat to xt_tgchk_param structure.

But it didn't set it's value for ipt_init_target. With unexpected value in par.nft_compat, it may return unexpected result in some target's checkentry.

This patch is to set all it's fields as 0 and only initialize the non-zero fields in ipt_init_target.

v1->v2:
As Wang Cong's suggestion, fix it by setting all it's fields as 0 and only initializing the non-zero fields.

Fixes 55917a21d0cc ("netfilter: x_tables: add context to know if extension runs from nft_compat")
---
 net/sched/act_ipt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/act_ipt.c +1 -1
@@ -49,8 +49,8 @@ static int ipt_init_target(struct xt_ent
 		return PTR_ERR(target);
 
 	t->u.kernel.target = target;
+	memset(&par, 0, sizeof(par));
 	par.table     = table;
-	par.entryinfo = NULL;
 	par.target    = target;
 	par.targinfo  = t->data;
 	par.hook_mask = hook;

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/net-sched-set-xt_tgchk_param-par.nft_compat-as-0-in-ipt_init_target.patch