Commit cf5000a
Florian Westphal
netfilter: nf_tables: fix memleak when more than 255 elements expired
When more than 255 elements expired we're supposed to switch to a new gc
container structure.
This never happens: u8 type will wrap before reaching the boundary
and nft_trans_gc_space() always returns true.
This means we recycle the initial gc container structure and
lose track of the elements that came before.
While at it, don't deref 'gc' after we've passed it to call_rcu.
Fixes: 5f68718 ("netfilter: nf_tables: GC transaction API to avoid race with control plane")
Reported-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Florian Westphal <fw@strlen.de>1 parent c9bd265 commit cf5000a
2 files changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1682 | 1682 | | |
1683 | 1683 | | |
1684 | 1684 | | |
1685 | | - | |
| 1685 | + | |
1686 | 1686 | | |
1687 | 1687 | | |
1688 | 1688 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9579 | 9579 | | |
9580 | 9580 | | |
9581 | 9581 | | |
| 9582 | + | |
| 9583 | + | |
9582 | 9584 | | |
9583 | 9585 | | |
9584 | 9586 | | |
| 9587 | + | |
9585 | 9588 | | |
9586 | 9589 | | |
9587 | | - | |
| 9590 | + | |
9588 | 9591 | | |
9589 | 9592 | | |
9590 | 9593 | | |
| |||
9599 | 9602 | | |
9600 | 9603 | | |
9601 | 9604 | | |
| 9605 | + | |
| 9606 | + | |
9602 | 9607 | | |
9603 | 9608 | | |
9604 | 9609 | | |
9605 | 9610 | | |
9606 | 9611 | | |
9607 | 9612 | | |
| 9613 | + | |
9608 | 9614 | | |
9609 | 9615 | | |
9610 | | - | |
| 9616 | + | |
9611 | 9617 | | |
9612 | 9618 | | |
9613 | 9619 | | |
| |||
0 commit comments