diff options
author | Florian Westphal <fw@strlen.de> | 2023-08-17 20:28:32 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2023-08-23 16:10:01 +0200 |
commit | 4b80ced971b0d118f9a11dd503a5833a5016de92 (patch) | |
tree | 9f5e5c55aaf8e3dcf19eed0e1acc88325edcceb8 /include | |
parent | bfedba3b2c7793ce127680bc8f70711e05ec7a17 (diff) | |
download | linux-stable-4b80ced971b0d118f9a11dd503a5833a5016de92.tar.gz linux-stable-4b80ced971b0d118f9a11dd503a5833a5016de92.tar.bz2 linux-stable-4b80ced971b0d118f9a11dd503a5833a5016de92.zip |
netfilter: nf_tables: validate all pending tables
We have to validate all tables in the transaction that are in
VALIDATE_DO state, the blamed commit below did not move the break
statement to its right location so we only validate one table.
Moreover, we can't init table->validate to _SKIP when a table object
is allocated.
If we do, then if a transcaction creates a new table and then
fails the transaction, nfnetlink will loop and nft will hang until
user cancels the command.
Add back the pernet state as a place to stash the last state encountered.
This is either _DO (we hit an error during commit validation) or _SKIP
(transaction passed all checks).
Fixes: 00c320f9b755 ("netfilter: nf_tables: make validation state per table")
Reported-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/netfilter/nf_tables.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h index e9ae567c037d..ffcbdf08380f 100644 --- a/include/net/netfilter/nf_tables.h +++ b/include/net/netfilter/nf_tables.h @@ -1729,6 +1729,7 @@ struct nftables_pernet { u64 table_handle; unsigned int base_seq; unsigned int gc_seq; + u8 validate_state; }; extern unsigned int nf_tables_net_id; |