]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: remove VLA usage
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Tue, 13 Mar 2018 03:16:17 +0000 (22:16 -0500)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 20 Mar 2018 12:41:39 +0000 (13:41 +0100)
commited416ab8745bd100c3342b6beab35bc366fd28ff
tree2d3b2876b1ba1481c5d3541bd482b0f2cfec0558
parent9c42e73762a44953905986355037fdeb2eec0ae1
netfilter: nf_tables: remove VLA usage

In preparation to enabling -Wvla, remove VLA and replace it
with dynamic memory allocation.

>From a security viewpoint, the use of Variable Length Arrays can be
a vector for stack overflow attacks. Also, in general, as the code
evolves it is easy to lose track of how big a VLA can get. Thus, we
can end up having segfaults that are hard to debug.

Also, fixed as part of the directive to remove all VLAs from
the kernel: https://lkml.org/lkml/2018/3/7/621

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c