Skip to content

Commit 94d514d

Browse files
committed
netfilter: nf_tables: deactivate catchall elements in next generation
JIRA: https://issues.redhat.com/browse/RHEL-1720 JIRA: https://issues.redhat.com/browse/RHEL-1721 Upstream Status: commit 90e5b34 commit 90e5b34 Author: Florian Westphal <fw@strlen.de> Date: Sat Aug 12 13:05:16 2023 +0200 netfilter: nf_tables: deactivate catchall elements in next generation When flushing, individual set elements are disabled in the next generation via the ->flush callback. Catchall elements are not disabled. This is incorrect and may lead to double-deactivations of catchall elements which then results in memory leaks: WARNING: CPU: 1 PID: 3300 at include/net/netfilter/nf_tables.h:1172 nft_map_deactivate+0x549/0x730 CPU: 1 PID: 3300 Comm: nft Not tainted 6.5.0-rc5+ #60 RIP: 0010:nft_map_deactivate+0x549/0x730 [..] ? nft_map_deactivate+0x549/0x730 nf_tables_delset+0xb66/0xeb0 (the warn is due to nft_use_dec() detecting underflow). Fixes: aaa3104 ("netfilter: nftables: add catch-all set element support") Reported-by: lonial con <kongln9170@gmail.com> Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Florian Westphal <fwestpha@redhat.com>
1 parent bd94f35 commit 94d514d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6831,6 +6831,7 @@ static int nft_set_catchall_flush(const struct nft_ctx *ctx,
68316831
ret = __nft_set_catchall_flush(ctx, set, &elem);
68326832
if (ret < 0)
68336833
break;
6834+
nft_set_elem_change_active(ctx->net, set, ext);
68346835
}
68356836

68366837
return ret;

0 commit comments

Comments
 (0)