]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: nf_tables: don't unregister hook when table is dormant
authorFlorian Westphal <fw@strlen.de>
Tue, 1 Apr 2025 12:36:47 +0000 (14:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:37:39 +0000 (14:37 +0200)
commit6134d1ea1e1408e8e7c8c26545b3b301cbdf1eda
treedc4882262599dd1b0c55d5757f438b8a681c6a27
parent073b04796c07e63055229c581d72a1c348525787
netfilter: nf_tables: don't unregister hook when table is dormant

[ Upstream commit 688c15017d5cd5aac882400782e7213d40dc3556 ]

When nf_tables_updchain encounters an error, hook registration needs to
be rolled back.

This should only be done if the hook has been registered, which won't
happen when the table is flagged as dormant (inactive).

Just move the assignment into the registration block.

Reported-by: syzbot+53ed3a6440173ddbf499@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=53ed3a6440173ddbf499
Fixes: b9703ed44ffb ("netfilter: nf_tables: support for adding new devices to an existing netdev chain")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_tables_api.c