mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 22:51:42 +00:00
netfilter: nf_tables: use WARN_ON_ONCE instead of BUG_ON in nft_do_chain()
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 <fw@strlen.de> Signed-off-by: Taehee Yoo <ap420073@gmail.com> Acked-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
0a2cf5ee43
commit
adc972c5b8
@ -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++;
|
||||
|
Loading…
Reference in New Issue
Block a user