Patch "netfilter: nf_tables: Add null check for nla_nest_start_noflag() in nft_dump_basechain_hook()" has been added to the 6.3-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: Add null check for nla_nest_start_noflag() in nft_dump_basechain_hook()

to the 6.3-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-add-null-check-for-nla_nest_star.patch
and it can be found in the queue-6.3 subdirectory.

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



commit 339efefd5dc5ee42ca69b5d590951543169b7746
Author: Gavrilov Ilia <Ilia.Gavrilov@xxxxxxxxxxx>
Date:   Wed May 24 12:25:27 2023 +0000

    netfilter: nf_tables: Add null check for nla_nest_start_noflag() in nft_dump_basechain_hook()
    
    [ Upstream commit bd058763a624a1fb5c20f3c46e632d623c043676 ]
    
    The nla_nest_start_noflag() function may fail and return NULL;
    the return value needs to be checked.
    
    Found by InfoTeCS on behalf of Linux Verification Center
    (linuxtesting.org) with SVACE.
    
    Fixes: d54725cd11a5 ("netfilter: nf_tables: support for multiple devices per netdev hook")
    Signed-off-by: Gavrilov Ilia <Ilia.Gavrilov@xxxxxxxxxxx>
    Signed-off-by: Florian Westphal <fw@xxxxxxxxx>
    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 ef80504c3ccd2..8c74bb1ca78a0 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -1593,6 +1593,8 @@ static int nft_dump_basechain_hook(struct sk_buff *skb, int family,
 
 	if (nft_base_chain_netdev(family, ops->hooknum)) {
 		nest_devs = nla_nest_start_noflag(skb, NFTA_HOOK_DEVS);
+		if (!nest_devs)
+			goto nla_put_failure;
 
 		if (!hook_list)
 			hook_list = &basechain->hook_list;



[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