Skip to content

Commit 40fc2b4

Browse files
lxingregkh
authored andcommitted
net: sched: set xt_tgchk_param par.nft_compat as 0 in ipt_init_target
[ Upstream commit 96d9703050a0036a3360ec98bb41e107c90664fe ] Commit 55917a2 ("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: 55917a2 ("netfilter: x_tables: add context to know if extension runs from nft_compat") Suggested-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d0da287 commit 40fc2b4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/sched/act_ipt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ static int ipt_init_target(struct xt_entry_target *t, char *table, unsigned int
4242
return PTR_ERR(target);
4343

4444
t->u.kernel.target = target;
45+
memset(&par, 0, sizeof(par));
4546
par.table = table;
46-
par.entryinfo = NULL;
4747
par.target = target;
4848
par.targinfo = t->data;
4949
par.hook_mask = hook;

0 commit comments

Comments
 (0)