Patch "netfilter: nf_tables: NULL pointer dereference in nf_tables_updobj()" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    netfilter: nf_tables: NULL pointer dereference in nf_tables_updobj()

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     netfilter-nf_tables-null-pointer-dereference-in-nf_t.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 7d8be403bcb1da7ec203870d9abb40a2e68652f1
Author: Alok Tiwari <alok.a.tiwari@xxxxxxxxxx>
Date:   Tue Jan 17 07:45:49 2023 -0800

    netfilter: nf_tables: NULL pointer dereference in nf_tables_updobj()
    
    [ Upstream commit dac7f50a45216d652887fb92d6cd3b7ca7f006ea ]
    
    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@xxxxxxxxxx>
    Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 3ba8c291fcaa7..dca5352bdf3d7 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -6951,6 +6951,9 @@ static int nf_tables_newobj(struct sk_buff *skb, const struct nfnl_info *info,
 			return -EOPNOTSUPP;
 
 		type = __nft_obj_type_get(objtype);
+		if (WARN_ON_ONCE(!type))
+			return -ENOENT;
+
 		nft_ctx_init(&ctx, net, skb, info->nlh, family, table, NULL, nla);
 
 		return nf_tables_updobj(&ctx, type, nla[NFTA_OBJ_DATA], obj);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux