Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e70fb3ef authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso Committed by Greg Kroah-Hartman
Browse files

netfilter: nfnetlink_cthelper: unbreak userspace helper support



commit 703acd70f2496537457186211c2f03e792409e68 upstream.

Restore helper data size initialization and fix memcopy of the helper
data size.

Fixes: 157ffffe ("netfilter: nfnetlink_cthelper: reject too large userspace allocation requests")
Reviewed-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 37bc21bb
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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));