projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1992696
)
netfilter: x_tables: limit allocation requests for blob rule heads
author
Florian Westphal
<fw@strlen.de>
Tue, 27 Feb 2018 18:42:32 +0000
(19:42 +0100)
committer
Pablo Neira Ayuso
<pablo@netfilter.org>
Mon, 5 Mar 2018 22:15:43 +0000
(23:15 +0100)
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>
net/netfilter/x_tables.c
patch
|
blob
|
history
diff --git
a/net/netfilter/x_tables.c
b/net/netfilter/x_tables.c
index dc68ac49614a94168ab947e04d2855626afdccda..01f8e122e74ee3cd62afaa84bb6ebfe3d938d43d 100644
(file)
--- a/
net/netfilter/x_tables.c
+++ b/
net/netfilter/x_tables.c
@@
-894,6
+894,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);
}