Skip to content

Commit 137fbbc

Browse files
committed
netfilter: nf_tables: NULL pointer dereference in nf_tables_updobj()
jira LE-1907 Rebuild_History Non-Buildable kernel-5.14.0-427.33.1.el9_4 commit-author Alok Tiwari <alok.a.tiwari@oracle.com> commit dac7f50 static analyzer detect null pointer dereference case for 'type' function __nft_obj_type_get() can return NULL value which require to handle if type is NULL pointer return -ENOENT. This is a theoretical issue, since an existing object has a type, but better add this failsafe check. Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> (cherry picked from commit dac7f50) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent ddc29cb commit 137fbbc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7333,6 +7333,9 @@ static int nf_tables_newobj(struct sk_buff *skb, const struct nfnl_info *info,
73337333
return -EOPNOTSUPP;
73347334

73357335
type = __nft_obj_type_get(objtype);
7336+
if (WARN_ON_ONCE(!type))
7337+
return -ENOENT;
7338+
73367339
nft_ctx_init(&ctx, net, skb, info->nlh, family, table, NULL, nla);
73377340

73387341
return nf_tables_updobj(&ctx, type, nla[NFTA_OBJ_DATA], obj);

0 commit comments

Comments
 (0)