mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 06:25:52 +02:00
netfilter: nfnetlink_cthelper: unbreak userspace helper support
commit703acd70f2upstream. Restore helper data size initialization and fix memcopy of the helper data size. Fixes:157ffffeb5("netfilter: nfnetlink_cthelper: reject too large userspace allocation requests") Reviewed-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
37bc21bb26
commit
e70fb3eff0
|
|
@ -106,7 +106,7 @@ nfnl_cthelper_from_nlattr(struct nlattr *attr, struct nf_conn *ct)
|
|||
if (help->helper->data_len == 0)
|
||||
return -EINVAL;
|
||||
|
||||
nla_memcpy(help->data, nla_data(attr), sizeof(help->data));
|
||||
nla_memcpy(help->data, attr, sizeof(help->data));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -242,6 +242,7 @@ nfnl_cthelper_create(const struct nlattr * const tb[],
|
|||
ret = -ENOMEM;
|
||||
goto err2;
|
||||
}
|
||||
helper->data_len = size;
|
||||
|
||||
helper->flags |= NF_CT_HELPER_F_USERSPACE;
|
||||
memcpy(&helper->tuple, tuple, sizeof(struct nf_conntrack_tuple));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user