Patch "net/mlx5: DR, prevent potential error pointer dereference" 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

    net/mlx5: DR, prevent potential error pointer dereference

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:
     net-mlx5-dr-prevent-potential-error-pointer-derefere.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 2b8f36bc073a7b87bce748787685616643cb33b2
Author: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Date:   Wed Dec 4 15:06:41 2024 +0300

    net/mlx5: DR, prevent potential error pointer dereference
    
    [ Upstream commit 11776cff0b563c8b8a4fa76cab620bfb633a8cb8 ]
    
    The dr_domain_add_vport_cap() function generally returns NULL on error
    but sometimes we want it to return ERR_PTR(-EBUSY) so the caller can
    retry.  The problem here is that "ret" can be either -EBUSY or -ENOMEM
    and if it's and -ENOMEM then the error pointer is propogated back and
    eventually dereferenced in dr_ste_v0_build_src_gvmi_qpn_tag().
    
    Fixes: 11a45def2e19 ("net/mlx5: DR, Add support for SF vports")
    Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
    Reviewed-by: Tariq Toukan <tariqt@xxxxxxxxxx>
    Link: https://patch.msgid.link/07477254-e179-43e2-b1b3-3b9db4674195@stanley.mountain
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c
index fc6ae49b5ecc..d462017c6a95 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c
@@ -195,7 +195,9 @@ dr_domain_add_vport_cap(struct mlx5dr_domain *dmn, u16 vport)
 	if (ret) {
 		mlx5dr_dbg(dmn, "Couldn't insert new vport into xarray (%d)\n", ret);
 		kvfree(vport_caps);
-		return ERR_PTR(ret);
+		if (ret == -EBUSY)
+			return ERR_PTR(-EBUSY);
+		return NULL;
 	}
 
 	return vport_caps;




[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