summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2020-05-24 21:04:42 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-03 08:19:47 +0200
commite70fb3eff0e2776c6bf9d9600f5868a548882ad8 (patch)
tree92f3fa5c49e0d9d152e6a16b560f894abdf6ee2a /net
parent37bc21bb264b50e2b88c642151979eb6b1ab2620 (diff)
downloadlinux-stable-e70fb3eff0e2776c6bf9d9600f5868a548882ad8.tar.gz
linux-stable-e70fb3eff0e2776c6bf9d9600f5868a548882ad8.tar.bz2
linux-stable-e70fb3eff0e2776c6bf9d9600f5868a548882ad8.zip
netfilter: nfnetlink_cthelper: unbreak userspace helper support
commit 703acd70f2496537457186211c2f03e792409e68 upstream. Restore helper data size initialization and fix memcopy of the helper data size. Fixes: 157ffffeb5dc ("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>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/nfnetlink_cthelper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c
index 66154dafa305..ddcb1b607474 100644
--- a/net/netfilter/nfnetlink_cthelper.c
+++ b/net/netfilter/nfnetlink_cthelper.c
@@ -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));