Commit 5b4c6e3
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>1 parent 1446385 commit 5b4c6e3
1 file changed
+15
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4357 | 4357 | | |
4358 | 4358 | | |
4359 | 4359 | | |
4360 | | - | |
| 4360 | + | |
4361 | 4361 | | |
4362 | 4362 | | |
4363 | | - | |
| 4363 | + | |
| 4364 | + | |
| 4365 | + | |
| 4366 | + | |
| 4367 | + | |
4364 | 4368 | | |
4365 | 4369 | | |
4366 | 4370 | | |
4367 | 4371 | | |
4368 | 4372 | | |
4369 | | - | |
| 4373 | + | |
4370 | 4374 | | |
4371 | 4375 | | |
4372 | 4376 | | |
| |||
4375 | 4379 | | |
4376 | 4380 | | |
4377 | 4381 | | |
4378 | | - | |
| 4382 | + | |
4379 | 4383 | | |
4380 | 4384 | | |
4381 | 4385 | | |
4382 | 4386 | | |
4383 | 4387 | | |
4384 | 4388 | | |
4385 | 4389 | | |
4386 | | - | |
4387 | | - | |
| 4390 | + | |
| 4391 | + | |
4388 | 4392 | | |
4389 | 4393 | | |
4390 | 4394 | | |
4391 | | - | |
| 4395 | + | |
4392 | 4396 | | |
4393 | 4397 | | |
4394 | 4398 | | |
| 4399 | + | |
4395 | 4400 | | |
4396 | | - | |
| 4401 | + | |
4397 | 4402 | | |
| 4403 | + | |
| 4404 | + | |
4398 | 4405 | | |
4399 | 4406 | | |
4400 | 4407 | | |
| |||
0 commit comments