]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: nf_tables: release batch on table validation from abort path
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 28 Mar 2024 12:27:36 +0000 (13:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:35:49 +0000 (16:35 +0200)
commitb0b36dcbe0f24383612e5e62bd48df5a8107f7fc
tree34618641e48ea86364b57eee1dd51a1340acb972
parentd75632d0db3cdc31873d25756066a7f56bc87737
netfilter: nf_tables: release batch on table validation from abort path

commit a45e6889575c2067d3c0212b6bc1022891e65b91 upstream.

Unlike early commit path stage which triggers a call to abort, an
explicit release of the batch is required on abort, otherwise mutex is
released and commit_list remains in place.

Add WARN_ON_ONCE to ensure commit_list is empty from the abort path
before releasing the mutex.

After this patch, commit_list is always assumed to be empty before
grabbing the mutex, therefore

  03c1f1ef1584 ("netfilter: Cleanup nft_net->module_list from nf_tables_exit_net()")

only needs to release the pending modules for registration.

Cc: stable@vger.kernel.org
Fixes: c0391b6ab810 ("netfilter: nf_tables: missing validation from the abort path")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nf_tables_api.c