]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: fix underflow in chain reference counter
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 25 Jun 2023 22:42:19 +0000 (00:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Aug 2023 08:23:46 +0000 (10:23 +0200)
commitb068314fd8ce751a7f906e55bb90f3551815f1a0
treee288c39344e9e537d3fd7df4b05119401508f13e
parent35651fde1a7bb54dde0a46d35cd0d7136869ae86
netfilter: nf_tables: fix underflow in chain reference counter

commit b389139f12f287b8ed2e2628b72df89a081f0b59 upstream.

Set element addition error path decrements reference counter on chains
twice: once on element release and again via nft_data_release().

Then, d6b478666ffa ("netfilter: nf_tables: fix underflow in object
reference counter") incorrectly fixed this by removing the stateful
object reference count decrement.

Restore the stateful object decrement as in b91d90368837 ("netfilter:
nf_tables: fix leaking object reference count") and let
nft_data_release() decrement the chain reference counter, so this is
done only once.

Fixes: d6b478666ffa ("netfilter: nf_tables: fix underflow in object reference counter")
Fixes: 628bd3e49cba ("netfilter: nf_tables: drop map element references from preparation phase")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nf_tables_api.c