netfilter: nft_compat: fix handling of large matchinfo size
authorFlorian Westphal <fw@strlen.de>
Mon, 7 May 2018 13:22:36 +0000 (15:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Jul 2018 13:30:48 +0000 (15:30 +0200)
commit365e73e07fba4c343510adf49d18cb2b97337df8
treeed224c684c6b472134a26b85e5c6f710b1463508
parentea200cdd605662de24f7cd92e03aa6a335e0b4da
netfilter: nft_compat: fix handling of large matchinfo size

commit 732a8049f365f514d0607e03938491bf6cb0d620 upstream.

currently matchinfo gets stored in the expression, but some xt matches
are very large.

To handle those we either need to switch nft core to kvmalloc and increase
size limit, or allocate the info blob of large matches separately.

This does the latter, this limits the scope of the changes to
nft_compat.

I picked a threshold of 192, this allows most matches to work as before and
handle only few ones via separate alloation (cgroup, u32, sctp, rt).

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nft_compat.c