mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
netfilter: nf_tables: skip transaction if update object is not implemented
[ Upstream commit84b1a0c014
] Turn update into noop as a follow up for:9fedd894b4
("netfilter: nf_tables: fix unexpected EOPNOTSUPP error") instead of adding a transaction object which is simply discarded at a later stage of the commit protocol. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Stable-dep-of:cddc04275f
("netfilter: nf_tables: must hold rcu read lock while iterating object type list") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
7f6f583be3
commit
7703551d0b
@ -7313,6 +7313,9 @@ static int nf_tables_newobj(struct sk_buff *skb, const struct nfnl_info *info,
|
||||
if (WARN_ON_ONCE(!type))
|
||||
return -ENOENT;
|
||||
|
||||
if (!obj->ops->update)
|
||||
return 0;
|
||||
|
||||
nft_ctx_init(&ctx, net, skb, info->nlh, family, table, NULL, nla);
|
||||
|
||||
return nf_tables_updobj(&ctx, type, nla[NFTA_OBJ_DATA], obj);
|
||||
@ -8972,9 +8975,10 @@ static void nft_obj_commit_update(struct nft_trans *trans)
|
||||
obj = nft_trans_obj(trans);
|
||||
newobj = nft_trans_obj_newobj(trans);
|
||||
|
||||
if (obj->ops->update)
|
||||
obj->ops->update(obj, newobj);
|
||||
if (WARN_ON_ONCE(!obj->ops->update))
|
||||
return;
|
||||
|
||||
obj->ops->update(obj, newobj);
|
||||
nft_obj_destroy(&trans->ctx, newobj);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user