Skip to content

Commit 703acd7

Browse files
committed
netfilter: nfnetlink_cthelper: unbreak userspace helper support
Restore helper data size initialization and fix memcopy of the helper data size. Fixes: 157ffff ("netfilter: nfnetlink_cthelper: reject too large userspace allocation requests") Reviewed-by: Florian Westphal <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent ee04805 commit 703acd7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/netfilter/nfnetlink_cthelper.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ nfnl_cthelper_from_nlattr(struct nlattr *attr, struct nf_conn *ct)
103103
if (help->helper->data_len == 0)
104104
return -EINVAL;
105105

106-
nla_memcpy(help->data, nla_data(attr), sizeof(help->data));
106+
nla_memcpy(help->data, attr, sizeof(help->data));
107107
return 0;
108108
}
109109

@@ -240,6 +240,7 @@ nfnl_cthelper_create(const struct nlattr * const tb[],
240240
ret = -ENOMEM;
241241
goto err2;
242242
}
243+
helper->data_len = size;
243244

244245
helper->flags |= NF_CT_HELPER_F_USERSPACE;
245246
memcpy(&helper->tuple, tuple, sizeof(struct nf_conntrack_tuple));

0 commit comments

Comments
 (0)