netfilter: nfnetlink: Remove VLA usage
authorKees Cook <keescook@chromium.org>
Wed, 30 May 2018 19:17:56 +0000 (12:17 -0700)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 1 Jun 2018 07:47:42 +0000 (09:47 +0200)
commit7b7744e2aa93864b2a490fb3533e9417d21cadc0
tree9bf5e9c52b653f9907ce72e729acda9dc255c639
parent2a79fd3908acd88e6cb0e620c314d7b1fee56a02
netfilter: nfnetlink: Remove VLA usage

In the quest to remove all stack VLA usage from the kernel[1], this
allocates the maximum size expected for all possible attrs and adds
sanity-checks at both registration and usage to make sure nothing
gets out of sync.

[1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nfnetlink.c