Patch "i40e: Add checking for null for nlmsg_find_attr()" has been added to the 5.10-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

    i40e: Add checking for null for nlmsg_find_attr()

to the 5.10-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:
     i40e-add-checking-for-null-for-nlmsg_find_attr.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 34c32c325e2024b80cace9cda73f0a60d4aa558f
Author: Natalia Petrova <n.petrova@xxxxxxxxxx>
Date:   Thu Feb 9 09:28:33 2023 -0800

    i40e: Add checking for null for nlmsg_find_attr()
    
    [ Upstream commit 7fa0b526f865cb42aa33917fd02a92cb03746f4d ]
    
    The result of nlmsg_find_attr() 'br_spec' is dereferenced in
    nla_for_each_nested(), but it can take NULL value in nla_find() function,
    which will result in an error.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: 51616018dd1b ("i40e: Add support for getlink, setlink ndo ops")
    Signed-off-by: Natalia Petrova <n.petrova@xxxxxxxxxx>
    Reviewed-by: Jesse Brandeburg <jesse.brandeburg@xxxxxxxxx>
    Tested-by: Gurucharan G <gurucharanx.g@xxxxxxxxx> (A Contingent worker at Intel)
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20230209172833.3596034-1-anthony.l.nguyen@xxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index c4f4ee34d58a0..9e8a20a94862f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -12520,6 +12520,8 @@ static int i40e_ndo_bridge_setlink(struct net_device *dev,
 	}
 
 	br_spec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), IFLA_AF_SPEC);
+	if (!br_spec)
+		return -EINVAL;
 
 	nla_for_each_nested(attr, br_spec, rem) {
 		__u16 mode;



[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