Commit 7fb818f
netfilter: nf_tables: Fix entries val in rule reset audit log
The value in idx and the number of rules handled in that particular
__nf_tables_dump_rules() call is not identical. The former is a cursor
to pick up from if multiple netlink messages are needed, so its value is
ever increasing. Fixing this is not just a matter of subtracting s_idx
from it, though: When resetting rules in multiple chains,
__nf_tables_dump_rules() is called for each and cb->args[0] is not
adjusted in between. Introduce a dedicated counter to record the number
of rules reset in this call in a less confusing way.
While being at it, prevent the direct return upon buffer exhaustion: Any
rules previously dumped into that skb would evade audit logging
otherwise.
Fixes: 9b5ba5c ("netfilter: nf_tables: Unbreak audit log reset")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Reviewed-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>1 parent 4908d5a commit 7fb818f
1 file changed
Lines changed: 10 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3451 | 3451 | | |
3452 | 3452 | | |
3453 | 3453 | | |
| 3454 | + | |
| 3455 | + | |
3454 | 3456 | | |
3455 | 3457 | | |
3456 | 3458 | | |
| |||
3473 | 3475 | | |
3474 | 3476 | | |
3475 | 3477 | | |
3476 | | - | |
3477 | | - | |
3478 | | - | |
| 3478 | + | |
| 3479 | + | |
| 3480 | + | |
| 3481 | + | |
| 3482 | + | |
3479 | 3483 | | |
3480 | 3484 | | |
3481 | 3485 | | |
3482 | 3486 | | |
3483 | 3487 | | |
3484 | 3488 | | |
3485 | 3489 | | |
3486 | | - | |
3487 | | - | |
| 3490 | + | |
| 3491 | + | |
3488 | 3492 | | |
3489 | | - | |
| 3493 | + | |
3490 | 3494 | | |
3491 | 3495 | | |
3492 | 3496 | | |
| |||
0 commit comments