netfilter: compat: reject huge allocation requests
commit764f2162d97a498269c9b67607fe163692a79aa7
authorFlorian Westphal <fw@strlen.de>
Tue, 27 Feb 2018 18:42:35 +0000 (27 19:42 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Apr 2018 09:02:21 +0000 (26 11:02 +0200)
tree95ebfe25a9b8e93883e2e343a615d26204780401
parent8d92d53365395c97cf819a10cda4693f792cd5b6
netfilter: compat: reject huge allocation requests

commit 7d7d7e02111e9a4dc9d0658597f528f815d820fd upstream.

no need to bother even trying to allocating huge compat offset arrays,
such ruleset is rejected later on anyway becaus we refuse to allocate
overly large rule blobs.

However, compat translation happens before blob allocation, so we should
add a check there too.

This is supposed to help with fuzzing by avoiding oom-killer.

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/x_tables.c