mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-07-10 00:33:22 -04:00
netfilter: nf_tables: fix possible null-pointer dereference in object update
Not all objects have an update operation. If the object type doesn't
implement an update operation and the user tries to update it will hit
EOPNOTSUPP.
Fixes: d62d0ba97b
("netfilter: nf_tables: Introduce stateful object update operation")
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
85936e56e9
commit
aa4095a156
1 changed files with 3 additions and 0 deletions
|
@ -5140,6 +5140,9 @@ static int nf_tables_updobj(const struct nft_ctx *ctx,
|
||||||
struct nft_trans *trans;
|
struct nft_trans *trans;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
if (!obj->ops->update)
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
trans = nft_trans_alloc(ctx, NFT_MSG_NEWOBJ,
|
trans = nft_trans_alloc(ctx, NFT_MSG_NEWOBJ,
|
||||||
sizeof(struct nft_trans_obj));
|
sizeof(struct nft_trans_obj));
|
||||||
if (!trans)
|
if (!trans)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue