mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
netfilter: nftables: disallow updates on table ownership
Disallow updating the ownership bit on an existing table: Do not allow
to grab ownership on an existing table. Do not allow to drop ownership
on an existing table.
Fixes: 6001a930ce
("netfilter: nftables: introduce table ownership")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
@@ -916,6 +916,12 @@ static int nf_tables_updtable(struct nft_ctx *ctx)
|
|||||||
if (flags == ctx->table->flags)
|
if (flags == ctx->table->flags)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if ((nft_table_has_owner(ctx->table) &&
|
||||||
|
!(flags & NFT_TABLE_F_OWNER)) ||
|
||||||
|
(!nft_table_has_owner(ctx->table) &&
|
||||||
|
flags & NFT_TABLE_F_OWNER))
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
trans = nft_trans_alloc(ctx, NFT_MSG_NEWTABLE,
|
trans = nft_trans_alloc(ctx, NFT_MSG_NEWTABLE,
|
||||||
sizeof(struct nft_trans_table));
|
sizeof(struct nft_trans_table));
|
||||||
if (trans == NULL)
|
if (trans == NULL)
|
||||||
|
Reference in New Issue
Block a user