Commit 3367abad authored by Florian Westphal's avatar Florian Westphal Committed by Treehugger Robot
Browse files

UPSTREAM: netfilter: nf_tables: deactivate catchall elements in next generation



[ Upstream commit 90e5b346 ]

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).

Bug: 298710879
Fixes: aaa31047 ("netfilter: nftables: add catch-all set element support")
Reported-by: default avatarlonial con <kongln9170@gmail.com>
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
(cherry picked from commit 00ea7eb1)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: I870613042789da3ab44f5f34a240f5dc8c4b25a2
parent a891f77b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment