mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-09 01:59:41 +00:00
netfilter: x_tables: limit allocation requests for blob rule heads
commit 9d5c12a7c0
upstream.
This is a very conservative limit (134217728 rules), but good
enough to not trigger frequent oom from syzkaller.
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>
This commit is contained in:
parent
764f2162d9
commit
5bcf169444
1 changed files with 3 additions and 0 deletions
|
@ -819,6 +819,9 @@ EXPORT_SYMBOL(xt_check_entry_offsets);
|
|||
*/
|
||||
unsigned int *xt_alloc_entry_offsets(unsigned int size)
|
||||
{
|
||||
if (size > XT_MAX_TABLE_SIZE / sizeof(unsigned int))
|
||||
return NULL;
|
||||
|
||||
return kvmalloc_array(size, sizeof(unsigned int), GFP_KERNEL | __GFP_ZERO);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue