projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0a2cf5e
)
netfilter: nf_tables: use WARN_ON_ONCE instead of BUG_ON in nft_do_chain()
author
Taehee Yoo
<
[email protected]
>
Mon, 11 Jun 2018 13:16:33 +0000
(22:16 +0900)
committer
Pablo Neira Ayuso
<
[email protected]
>
Tue, 12 Jun 2018 17:30:11 +0000
(19:30 +0200)
When depth of chain is bigger than NFT_JUMP_STACK_SIZE, the nft_do_chain
crashes. But there is no need to crash hard here.
Suggested-by: Florian Westphal <
[email protected]
>
Signed-off-by: Taehee Yoo <
[email protected]
>
Acked-by: Florian Westphal <
[email protected]
>
Signed-off-by: Pablo Neira Ayuso <
[email protected]
>
net/netfilter/nf_tables_core.c
patch
|
blob
|
history
diff --git
a/net/netfilter/nf_tables_core.c
b/net/netfilter/nf_tables_core.c
index deff10adef9c4b97bf60f0f5d18d46e33fcfd348..8de912ca53d3bfb1b2a924cbeb655d8e4d4ebd3a 100644
(file)
--- a/
net/netfilter/nf_tables_core.c
+++ b/
net/netfilter/nf_tables_core.c
@@
-183,7
+183,8
@@
next_rule:
switch (regs.verdict.code) {
case NFT_JUMP:
- BUG_ON(stackptr >= NFT_JUMP_STACK_SIZE);
+ if (WARN_ON_ONCE(stackptr >= NFT_JUMP_STACK_SIZE))
+ return NF_DROP;
jumpstack[stackptr].chain = chain;
jumpstack[stackptr].rules = rules + 1;
stackptr++;